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
rucknrun
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:

RESULT_ID CODE
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.

Neil


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: 64145
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.

Regards
Michel

[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
BlackSwan
Messages: 25049
Registered: January 2009
Location: SoCal
Senior Member
http://www.orafaq.com/forum/t/88153/0/
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: Link: Exception handling
Next Topic: Decode with conditions
Goto Forum:
  


Current Time: Fri Dec 09 12:01:36 CST 2016

Total time taken to generate the page: 0.16168 seconds