Skip to content
Advertisement

SQL query for key and value

I need to write a query that does the following. After searching various forums I see “PIVOT” is one of the ways to implement this. I am still trying to write an query using PIVOT but in the meantime can anyone suggest if there is any other alternate way to do the same?

OUTPUT from query expected:

Advertisement

Answer

use conditional aggregation

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