1 person found this helpful
MAX(decode(DAY,1,result,0)) AS "1",
MAX(decode(DAY,2,result,0)) AS "2",
MAX(decode(day,3,result,0)) as "3"
MAX(decode(day,31,result,0)) as "31"
SELECT MODEL,DAY,sum(num) AS result
GROUP BY MODEL,DAY
) group by model;
You cannot number as a column name and I have changed that to num here.
Thank you very much and thank everybody comment in here .