Hi,
I need help in creating the unPIVOT query for below requirement
OrderNo----Charge1----Charge2----Charge3----charge4------------------------around 20 columns--------------
12234-------100---------200-------------300------------100
34568--------200--------500-------------500------------100
select Order, chargedesc, amount
from table1
unpivot( amount For chargedesc IN (charge1,charge2,charge3,charge4)
) as t_unpivot
I am able to do UNPIVOT just with required column, but when I add with other 20 column and multiple joins it is giving error.
Any pointer will be helpful. thanks