column to rows [message #437125] |
Thu, 31 December 2009 03:03 |
newuser1
Messages: 4 Registered: December 2009 Location: pune
|
Junior Member |
|
|
I have following table tb1
ID cd1 cd2 cd3
1 a b c
2 r t y
The output should be as follow and then i want to insert into tb2
ID code
1 a
1 b
1 c
2 r
2 t
2 y
please tell how i can do this in oracle
|
|
|
|
|
Re: column to rows [message #437130 is a reply to message #437125] |
Thu, 31 December 2009 03:24 |
|
Michel Cadot
Messages: 68704 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
This is a FAQ, please search before posting.
Use a row generator (line 1 to 3), join your table with it, display the column you want depending og the line.
Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version with 4 decimals.
Post a workingTest case: create table and insert statements along with the result you want with these data.
Regards
Michel
|
|
|