Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> How do I return a column into a row ?

How do I return a column into a row ?

From: C Chang <cschang_at_maxinter.net>
Date: Thu, 31 Jan 2002 22:57:19 -0500
Message-ID: <3C5A121F.370F@maxinter.net>


I have record set like following:

   ID     name   Qty  
    1      A      4
    1      B      10
    1      C       2
    2      B      5
    2      D      1
    3      A       6
    3      C       2
    3      D       7

I have tried 3 days to get my result like but can't

    ID      A    B    C   D
     1      4    10   2
     2           5        1
     3      6         2   7

I tried to use a select stmt as

SELECT ID, f(A,ID), f(B,ID), f(C,ID), f(D,ID) FROM a_table
WHERE conditon =..

But the problem is when the return ID becomes so huge, that the call of function will be saturating the memory stack area. Anyone has better suggestion? Very thanks.

C Chang Received on Thu Jan 31 2002 - 21:57:19 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US