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 to flatten cols into rows

How to flatten cols into rows

From: hedrew3 <peteg_at_garlic.com>
Date: 29 Jan 2004 23:22:22 -0800
Message-ID: <aad10be0.0401292322.7b6c320b@posting.google.com>


I have a single table, as follows:

Col_A       Col_B
------      ------
Joe          X
Joe          Y
Joe          Z
Bob          A
Bob          B

and I need to have a result set that looks like:

Joe          X Y Z
Bob          A B

The first column may have anywhere from 1 to max of 5 entries. Is this possible in SQL, or do I need to do it in PL/SQL?

TIA Pete Received on Fri Jan 30 2004 - 01:22:22 CST

Original text of this message

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