question

John Graff avatar image
John Graff asked

change row text to single column

I want to combine multiple text by id till next id

ID           text                    
12           car                    
12           boat                    
12           house                    

into

id          text                    
12          car, boat, house                    
sql-server-2005csv
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

graz avatar image graz ♦ commented ·
John, if you use one of these methods can you mark one of the answers as the one you accepted?
0 Likes 0 ·
Madhivanan avatar image Madhivanan commented ·
I see that many people simply ask questions and dont follow them
0 Likes 0 ·
graz avatar image
graz answered

Will the approach at the bottom of this article work?

http://www.sqlteam.com/article/using-coalesce-to-build-comma-delimited-string

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Madhivanan avatar image
Madhivanan answered
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ERussell avatar image
ERussell answered
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.