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

Home -> Community -> Usenet -> c.d.o.server -> Transposing a table !

Transposing a table !

From: Yannick <elnikou_at_wanadoo.fr>
Date: 2000/05/10
Message-ID: <391914E1.70286CAC@wanadoo.fr>#1/1

Here is the problem :

I have the following table tbla :

Prod_no val_1 val_2 val_3 ....


P1                5            15        10
P2                8             6            4

.....

and I would like to get following result :

Prod_no val_no value


P1                    1                5
P1                    2                15
P1                    3                10
P2                    1                8
P2                    2                6
P2                    3                4
....

Can anybody help me to find a nice solution avoinding something like select prod_no,1,val_1 from tbla union select prod_no,2,val_2 from tbla
.....

Thanks in advance Received on Wed May 10 2000 - 00:00:00 CDT

Original text of this message

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