Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Challenging rows to columns problem
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
![]() |
![]() |