I have this table: table
And I want to know if there is some SQL query to return something like this: result
I tried this but didn't work:
SELECT Object,
SUM(CASE WHEN Key = 'A' THEN Qty END) As Key A,
SUM(CASE WHEN Key = 'B' THEN Qty END) As Key B
FROM tab
And even added the GROUP BY clause but the error is at the CASE clause