Home » SQL & PL/SQL » SQL & PL/SQL » Combining multiple rows into one row (Oracle 10g)
Combining multiple rows into one row [message #279287] Wed, 07 November 2007 10:48 Go to next message
jordan_dba
Messages: 19
Registered: May 2007
Location: SF, CA
Junior Member
Hello mates..

I am trying to come up with the right sql to combine multiple rows into one within an existing view. The data in the table I am selecting from looks like this

ID Color
1001 Blue
1001 Yellow
1001 Pink
1001 Green

The ID column is the primary key on the table and the data is needed in this format...

ID Color
1001 blue, yellow, pink, green



Thanks in advance for your help.
Re: Combining multiple rows into one row [message #279290 is a reply to message #279287] Wed, 07 November 2007 10:52 Go to previous messageGo to next message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
This was already answered today.
Re: Combining multiple rows into one row [message #279292 is a reply to message #279287] Wed, 07 November 2007 10:54 Go to previous messageGo to next message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
To be honest i don't know how many more individuals is going to ask the same question again and again and again. Please click the search button and search for the keyword (pivot, stragg, model etc.). It's been asked loads of times in every single forum i have visited. Now I understand why oracle introduced pivot in 11g. Smile

Sorry for being rude mate. Your first friend is google. You would have found a solution by this time if you would have googled it.

Michael, I agree with you completely (your previous post on pivot).

Regards

Raj
Re: Combining multiple rows into one row [message #279294 is a reply to message #279292] Wed, 07 November 2007 11:00 Go to previous messageGo to next message
jordan_dba
Messages: 19
Registered: May 2007
Location: SF, CA
Junior Member
Guilty as charged... funny enough Taj, I did a search before posting and actually found some threads on google that didn't meet what I was looking for, nothing on this forum though but the link above answers my question.

I really appreciate the efforts and should be fined for not looking thoroughly through all the threads from today. My apologies again. Hope no one is offended Smile



Cheers!
Re: Combining multiple rows into one row [message #279296 is a reply to message #279294] Wed, 07 November 2007 11:05 Go to previous message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
Not a problem . To be honest I learnt a lot by participating in this forums. But at the same time in every single forum i have visited they expect you to do something before asking for help. Because by doing that you learn a lot. If you are stuck, there are loads of members here to help you out with.

Hope you take it in a right sense.

Regards

Raj
Previous Topic: Odd behavior with bulk collect
Next Topic: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
Goto Forum:
  


Current Time: Mon Dec 05 15:18:38 CST 2016

Total time taken to generate the page: 0.18430 seconds