x

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                    

more ▼

asked Oct 13, 2009 at 09:29 AM in Default

avatar image

John Graff
11 1 1 3

John, if you use one of these methods can you mark one of the answers as the one you accepted?

Oct 13, 2009 at 12:33 PM graz ♦

I see that many people simply ask questions and dont follow them

Oct 14, 2009 at 09:24 AM Madhivanan
(comments are locked)
10|1200 characters needed characters left

3 answers: sort voted first

Will the approach at the bottom of this article work?

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

more ▼

answered Oct 13, 2009 at 09:38 AM

avatar image

graz ♦
525 2 6 10

(comments are locked)
10|1200 characters needed characters left
more ▼

answered Oct 13, 2009 at 09:49 AM

avatar image

Madhivanan
1.1k 2 5 9

(comments are locked)
10|1200 characters needed characters left
more ▼

answered Oct 13, 2009 at 12:28 PM

avatar image

ERussell
11

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x2016
x39

asked: Oct 13, 2009 at 09:29 AM

Seen: 1362 times

Last Updated: Oct 13, 2009 at 09:36 AM

Copyright 2016 Redgate Software. Privacy Policy