Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Group by/Order by Pivoting problem.
Hello Spongebob,
you can try something like this one below. The disadvantage is that you have to know the number of years/columns.
select x.ta_key,
max(case when x.nr = 3 then x.amt else null end) y1, max(case when x.nr = 2 then x.amt else null end) y2, max(case when x.nr = 1 then x.amt else null end) y3from
a.key ta_key, a.year, a.AMT
Regards,
Jörg Received on Thu Apr 06 2006 - 14:56:11 CDT