Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: rownum & group by question
Here is an example for test2 (YEAR INTEGER,AMOUNT INTEGER).
SELECT MAX(DECODE(YEAR,2005,SUM,NULL)),MAX(DECODE(YEAR,2004,SUM,NULL))
FROM
(SELECT YEAR,SUM(AMOUNT) as SUM FROM TEST2 GROUP BY YEAR )
Received on Wed Mar 22 2006 - 11:46:13 CST