Groups | Blog | Home
all groups > sql server programming > october 2006 >

sql server programming : Return as single row from multiple rows in a column


Anith Sen
10/5/2006 4:00:49 PM
For a one time data display or if this is used by a single application or a
report, you should retrieve the resultset to the client side, leverage the
display/presentation language's string manipulative features and
appropriately format the data there.

If this is more of a general requirement and used by several applications,
in certain cases it may make some sense to do it at the server using t-SQL.
For some options see: http://www.projectdmx.com/tsql/rowconcatenate.aspx

--
Anith

obelix via SQLMonster.com
10/5/2006 8:40:21 PM
I probably didnt make sense the first time around so I'll try again. I'm
selecting one field from a tbl but with a result set of more than one row and
I want to bring back all the rows in a single string.

--
obelix

"Whether you think you can or you think you cant you are right" .... Anon

Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-programming/200610/1
Grof
10/9/2006 3:28:40 PM
If I understand your question, try this...


select CONCAT_WS(spliter,first,second,etc) from...

or
select first + ' ' + second ...


EggHeadCafe.com - .NET Developer Portal of Choice
AddThis Social Bookmark Button