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 -> Challenging rows to columns problem

Challenging rows to columns problem

From: <puneet.bansal_at_wipro.com>
Date: 10 Jun 2005 13:50:17 -0700
Message-ID: <1118436617.536639.87100@o13g2000cwo.googlegroups.com>


Hi,

I am handling a complex query and ultimately the problem boils down to this.

I have the data in the format

 Col1      Col2
 X          a
 X          b
 Y          c
 Y          d
 Y          e
 Z          f
 Z          g

 but I need this data in the following format (note that the column  names have changed to the data)

 X         Y       Z
 a         c       f
 b         d       g
           e

Any idea how to achieve this? Col1 can have many values other than X,Y,Z and that many columns should come up in the final result. So the solution has to be generic that will work for any number of distinct values of col1.

Thanks.
Puneet Received on Fri Jun 10 2005 - 15:50:17 CDT

Original text of this message

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