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 -> Transpose Oracle Table (Rows to columns)

Transpose Oracle Table (Rows to columns)

From: <abhijitde_at_hotmail.com>
Date: Wed, 02 Dec 1998 19:41:05 GMT
Message-ID: <74454i$6s1$1@nnrp1.dejanews.com>


Hi everybody,

Could u please help me in solving a problem.

The problem is to transpose columns to rows dynamically.

The original table is -

Proj Prot Pid Labcode Result

001    1    1     HGB      100.00
001    1    1     RBC      200.00
001    1    1     HCT      300.00
001    1    2     HGB      150.00
001    1    2     HCT      112.00
001    1    2     RBC      150.00
001    1    2     XYZ      102.00

So, there could be say 60 labcodes vertically for each pid.

Now, the above has to be transposed to -

Proj   Prot  Pid   HGB     RBC     HCT      XYZ
001     1     1    100.00  200.00  300.00
001     1     2    150.00  150.00  112.00   102.00

Any help towards a solution is highly appreciated.

Thanks.

Abhijit

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Wed Dec 02 1998 - 13:41:05 CST

Original text of this message

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