|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Is it possible to write a sql query which returns an entire column values delimited by comma or some other delimiter.
E.g. if this is the data of a query : select sno,name from someTable sno name 1 abc 2 xyz 3 wsd ..... i want to write a single query which returns this ... colA colB 1,2,3 abc,xyz,wsd presently i am doing this with read only cursors many thanks |
|
#2
|
||||
|
||||
|
are you wanting this done inside the database? then no, you can't do it. If you are wanting to format it outside the database that way, then yes, you can do it.
|
|
#3
|
|||
|
|||
|
Warning: I believe this is SQL Server ONLY!
declare @RtnValue varchar(100) Select @RtnValue = COALESCE(@RtnValue+',' , ' ') + sno from someTable Select @RtnValue Quote:
|
|
#4
|
||||
|
||||
|
WARNING: You just responded to a thread that is over a year old.
Please don't resurrect dead threads. |
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > SQL Query (Comma delimited column) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|