Home » SQL & PL/SQL » SQL & PL/SQL » Convert multiple rows to one row
Convert multiple rows to one row [message #218376] Wed, 07 February 2007 23:05 Go to next message
lowcash75
Messages: 67
Registered: February 2006
Member
I have the following query, which returns multiple rows to a particular search criteria. I need those multiple rows concatenated to one row separated by ','

select b.data
from table_1 a, table_2 b
where a.id = b.id
and a.id = 5723
and b.type = 'TEST';

The data I'm get returned is as follows. In come instances could be 2 rows, whereas in some instances could be way more.
1
2
3
4
5
.
.
.


Result I want:
1,2,3,4,5,etc...

Please help!
Re: Convert multiple rows to one row [message #218390 is a reply to message #218376] Thu, 08 February 2007 00:34 Go to previous message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
Search this board for CONCAT_ALL

Ross Leishman
Previous Topic: execute stored procedure
Next Topic: Insert Blank to a not null column
Goto Forum:
  


Current Time: Mon Dec 05 12:39:52 CST 2016

Total time taken to generate the page: 0.04847 seconds