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 -> SQL Question - Transpose rows to columns

SQL Question - Transpose rows to columns

From: George Dimopoulos <george_at_cheos.ubc.ca>
Date: Thu, 3 Dec 1998 09:44:21 -0800
Message-ID: <746ije$p0p$1@nntp.ucs.ubc.ca>


Are you able to transpose rows to columns easily with a single sql statement?

example

select id, (select value from lab where code = 'HG' AND patient_id = l.patient_id(+)) HG,

              (select value from lab where code = 'CR' and patient_id = l.patient_id(+) CR
from lab l Received on Thu Dec 03 1998 - 11:44:21 CST

Original text of this message

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