views:

19

answers:

2

select col1 from tablename returns 2 rows, i want to concat thse two rows data into single column as comma separated.

A: 

You can write a cursor to loop through the returned rows one by one and concatenate as you like.

johnbk
NO i need to do it only using a query
Faisal khan
@Faisal Khan - Daniel Emge's solution here should be helpful for you.http://stackoverflow.com/questions/468990/how-can-i-combine-multiple-rows-into-a-comma-delimited-list-in-oracle
johnbk
A: 

Here are some examples of same kind of situation: http://www.dba-oracle.com/t_converting_rows_columns.htm

oocce
I checked that the first one is at least working with no problems.
oocce