Skip to content
Advertisement

Transpose rows into columns in SQL Server, I try it using pivot but, expected result is not reached

Transpose rows into columns in SQL Server, I try it using pivot but, expected result is not reached, using pivot getting Max value only

Expected output:

enter image description here

Advertisement

Answer

You can use conditional aggregation with row_number():

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement