The example below illustrates how to UNPIVOT a table. The example can be used in both SQL Server 2000 and 2005. CREATE TABLE dbo.TableToUnPivot ( SalesYear INT, Q1 INT, Q2 INT, Q3 INT, Q4 INT ) INSERT dbo.TableToUnPivot SELECT 2003, 1, 2, 3, 4 INSERT
Read More...