Home » SQL & PL/SQL » SQL & PL/SQL » convert 1 row into multiple rows
convert 1 row into multiple rows [message #205838] Mon, 27 November 2006 20:11 Go to next message
mahekr2000
Messages: 8
Registered: July 2005
Location: USA
Junior Member
Guys - I have a table with 6 columns and it looks like this:

1 2 3 4 5 6

1 XX Y A Z ABC

2 XX P AB CN CAB


Now I want my output to be:


1 2 3 4 5 6

1 XX Y AAA AAB ABC
2 XX Y AAC AAD ABC
3 XX Y AAE AAF ABC......

26 XX Y AAY AAZ ABC


27 XX P ABA ABB CAB
28 XX P ABC ABD CAB

9999 XX P CNY CNZ CAB

I am trying to do this in SQL , but without much luck. I can always do it with pl-sql but I want to keep that as my last option.

Please, let me know if I need to explain this further...

Thanks..
Re: convert 1 row into multiple rows [message #205885 is a reply to message #205838] Tue, 28 November 2006 00:47 Go to previous message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
I'm trying to imagine what possible rule you might be applying to get that output from that input, but without much luck. I can always do it by getting a billion monkeys to type on a billion computers for a billion years, but I want to keep that as my last option.

Help us out a bit here. You say you could do it with PL/SQL. So do it with PL/SQL, show us the code, and ask if the same can be done with SQL.

Ross Leishman
Previous Topic: SQL Help
Next Topic: Filter data
Goto Forum:
  


Current Time: Tue Dec 06 04:49:42 CST 2016

Total time taken to generate the page: 0.09568 seconds