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!

Unpivot in 10g

759032Mar 9 2010 — edited Mar 10 2010
I need to query a bunch of views and create output like unpivot but with Oracle 10g
Need to query table for one record only but get the results as lines of key-value when the key is the column name and the value is he value in that column.
e.g. I have a table like this:
------------------
id | c1 | c2 | c3 |
------------------
1 | aa | bb | cc |
------------------
2 | dd | ee | ff |
------------------

the query:
SELECT <....> FROM Table where id=1

should bring:
c1, aa
c2, bb,
c3, cc,

Any ideas hot to do it?
This post has been answered by Frank Kulash on Mar 9 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 7 2010
Added on Mar 9 2010
6 comments
6,150 views