This question already has an answer here:
- Dynamic pivot: sum of sales per month 2 answers
I need to know whether 'pivot' in SQL Server can be used for converting rows to columns if there is no aggregate function to be used. I saw lot of examples with aggregate function only. My columns are string data type and I need to convert this row data to column data. This is why I wrote this question. I just did it with
case. Can anyone help me......Thanks in advance.
empid wagecode amount 1 basic 1000 1 TA 500 1 DA 500 2 Basic 1500 2 TA 750 2 DA 750
empid basic TA DA 1 1000 500 500 2 1500 750 750