i have a big trouble.. i have this schema on a tableid year var jan feb ...... etc.1 2008 var1 123 NULL2 2008 var2 678 87
and i need to change that schema toid year month var1 var21 2008 01 123 6781 2008 02 NULL 87
i tried with unpivot..Select id,year, month, var1from (select id, year, jun, feb .. etc from Xwhere var='var1') pUNPIVOT(var1 for mont in(jun, feb...etc)) as unpvt
but it was 51 selects and 51 temp tables to store the data in order(i have 51 var) and then a big select~join in order to remake the table >.< and takes a rly big time to make that operation.. so any good ideas for my problem??..
btw sorry for my bad english 