Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Transpose rows to columns in a format

KVBJan 29 2014 — edited Jan 29 2014

Hi All,
I have a requirement.
SELECT COLUMNNAME FROM tablename
In my scenario,the above statement returns the indexes applied on the table.It can be in any number.
For eg:I have combination of 2 columns in index.it returns 2 rows.let's say
index1
index2
Here I need to transpose the rows to a single column in the below format.
I need my output in this fashion (index1,index2)
If I have combination of 3 rows.The query returns 3 rows and my output should be (index1,index2,index3).

I am getting transposing in general.How to get it dynamically when the number of rows changes.

Regards
KVB

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 26 2014
Added on Jan 29 2014
3 comments
387 views