I need to rotate the table a little by changing the measurements. I use Pivot
, but the problem is that I do not understand how to select all the values in the column for the selector as column names and for processing the pivot
. Need instead:
select [2001], [2002], [2003] from table pivot( MAX(Value) for date in ([2001], [2002], [2003]) )as pvt
Something like:
select (select date from table) from table pivot( MAX(value) For date in (select date from table) )