Home » SQL & PL/SQL » SQL & PL/SQL » multiple values into one row (Oracle 10gR2)
multiple values into one row [message #330908] Tue, 01 July 2008 14:02 Go to next message
Messages: 26
Registered: April 2005
Location: Edgewood, MD
Junior Member

I have been trying to figure this out most of the day and can't. I searched the forums and could not find what I was looking for, I probably have my terminology wrong. I have a table that looks like below.

table results:

100000 FD
100000 FP
100001 ND
100002 FD
100002 AB
100003 ND

I would like to be able to write a query to display the records in the table like below:

result_id code
100000 FD FP
100001 ND
100002 FD AB
100003 ND

I was trying to get this to work with a connect by statement but it is not really a hierarchical relationship.

Any help would be appreciated.


Re: multiple values into one row [message #330910 is a reply to message #330908] Tue, 01 July 2008 14:06 Go to previous messageGo to next message
Michel Cadot
Messages: 65144
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You didn't search very well, this is a pivot query and is asked several times EACH WEEK.


[Updated on: Tue, 01 July 2008 14:06]

Report message to a moderator

Re: multiple values into one row [message #330911 is a reply to message #330908] Tue, 01 July 2008 14:07 Go to previous message
Messages: 25571
Registered: January 2009
Location: SoCal
Senior Member
Please read & follow posting guidelines as stated in URL above

What is supposed to occur when 3 or more rows have the same RESULT_ID
Previous Topic: Decode to display result of the columns in one row
Next Topic: add the unconsildate amount to match with consolidate amount
Goto Forum:

Current Time: Sun Aug 20 01:05:45 CDT 2017

Total time taken to generate the page: 0.12905 seconds