I have a table with the following data in SQL
SNO NAMES
------ -----------------
1 prasanna
1 lakshmi
1 Ravikumar
2 raja
2 lakshmi
2 natrajan
3 deepika
3 bidri
3 G
And I need the output as following using SQL query
SNO FNAME MNAME LNAME
1 prasanna Lakshmi Ravikumar
2 Raja Lakshmi natrajan
3 Deepika bidri G
If any one of U find the solution please let me know.
Conver columns to rows in oracle
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 10
- Joined: Fri May 12, 2006 12:31 am
It is not possible with the data you have provided. How do you identify which row corresponds to which name? How do you identify which row is the "first" row for a given SNO. In other words, you have no way to order your names. If you figure out some way to order your rows, then a search of the forum for vertical pivot should reveal some DataStage solutions.
Mike
Mike
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: