Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Analyzing This Query?
>>> SELECT
>>> DECODE(x.SAL, 1, x.SALQTY,0) SQTY1,
>>> DECODE(x.SAL, 2, x.SALQTY,0) SQTY2,
>>> DECODE(x.SAL, 3, x.SALQTY,0) SQTY3,
>>> DECODE(x.SAL, 4, x.SALQTY,0) SQTY4,
>>> DECODE(x.SAL, 5, x.SALQTY,0) SQTY5,
>>> DECODE(x.SAL, 1, x.SALNAME,0) SNAME1,
>>> DECODE(x.SAL, 2, x.SALNAME,0) SNAME2,
>>> DECODE(x.SAL, 3, x.SALNAME,0) SNAME3,
>>> DECODE(x.SAL, 4, x.SALNAME,0) SNAME4,
>>> DECODE(x.SAL, 5, x.SALNAME,0) SNAME5,
>>> FROM MYTABLE
Thanks for the reply Mark.
I was able find some material on pivot table but, sorry, i am not able
to relate this to my example.
I mean i was not able to find what exactly i should be doing with this
sql query in order to improve its efficiency.
One more thing, i know that i can replace the DECODE with CASE as it
executes faster. I just wanna know if there is some doc or link which
corresponds to the same?
TIA Received on Tue Feb 14 2006 - 05:29:43 CST