I find this at:
http://www.sqlservercurry.com/2008/06/combine-multiple-rows-into-one-row.html
==================================
-- Query to combine multiple rows into one
DECLARE @str VARCHAR(100)
SELECT @str = COALESCE(@str + '|', '') + [Numbers]
FROM #Temp
Print @str
You can also achieve the same result using STUFF
SELECT DISTINCT STUFF( (SELECT '*' + Numbers from #Temp FOR XML
PATH('')),1,1,'') as Numbers FROM #Temp
==================================
the first option is work only for one set of details rows, I need to
do that for many rows, so the second option on above simple is good
for me, but i ned it for SQL2000.
Have some other solution?
Madhivanan - 28 Jul 2008 11:10 GMT
> I find this at:
> http://www.sqlservercurry.com/2008/06/combine-multiple-rows-into-one-...
[quoted text clipped - 16 lines]
> for me, but i ned it for SQL2000.
> Have some other solution?
http://sqlblog.com/blogs/adam_machanic/archive/2006/07/12/rowset-string-concaten
ation-which-method-is-best.aspx