I have more then 500 columns that i need to use in unpivoting.
select col1 , col2 , col3
from ( select * from table )
unpivot (col3 for col2 in ('value', 'value2',....'value788'))
So instead of writing all these columns i used inner select of the table that holds all those values.
select col1 , col2 , col3
from ( select * from table )
unpivot (col3 for col2 in (select value_col from val_table))
but it is throwing error. unexpected select
Any suggestion