-- Example for unpivoting more than one rotation axis create table t1 ( keycol int not null identity, c2004a int null, c2005a int null, c2006a int null, c2004b int null, c2005b int null, c2006b int null ); insert into t1 values(10,20,30,40,50,60); insert into t1 values(110,120,130,140,null,160); select keycol, theyear, thestatus, case when theyear = 2004 and thestatus = 'a' then c2004a when theyear = 2005 and thestatus = 'a' then c2005a when theyear = 2006 and thestatus = 'a' then c2006a when theyear = 2004 and thestatus = 'b' then c2004b when theyear = 2005 and thestatus = 'b' then c2005b when theyear = 2006 and thestatus = 'b' then c2006b end as qty from t1, (select 2004 as theyear union all select 2005 union all select 2006) as y, (select 'a' as thestatus union all select 'b') as s; /* Output: keycol theyear thestatus qty ----------- ----------- --------- ----------- 1 2004 a 10 1 2005 a 20 1 2006 a 30 1 2004 b 40 1 2005 b 50 1 2006 b 60 2 2004 a 110 2 2005 a 120 2 2006 a 130 2 2004 b 140 2 2005 b NULL 2 2006 b 160 (12 row(s) affected) */