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!

Need help on Unpivot (Columns to rows conversion)

577854May 16 2007 — edited May 16 2007
Could you please help me to do unpivot using sql?
Table creation and insertion scripts:
create table REQ
(
ID NUMBER,
VALUE VARCHAR2(20)
);

insert into REQ (ID, VALUE)
values (1, 'HI,HELLO, KARTHI');
insert into REQ (ID, VALUE)
values (2, 'ARE,YOU,FINE,BHAR');
insert into REQ (ID, VALUE)
values (3, '100,200,300');
commit;

I need to view the data in the below format

ID VALUE
1 HI
1 HELLO
1 KARTHI
2 ARE
2 YOU
2 FINE
2 BHAR
3 100
3 200
3 300
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 13 2007
Added on May 16 2007
7 comments
519 views