Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Concatenate a column with multiple rows into one

Author  Topic 

ATG
Starting Member

35 Posts

Posted - 2011-12-21 : 18:10:30
What i'm trying to do is merge a colum with multiple rows into one.

Lets say I have a table called State that has 2 columns. State and City.

STATE CITY
CA San Francisco
CA San Diego
CA Los Angeles
NV Reno
NV Carson City
NV Las Vegas

I need it to display as 2 rows

CA San Francisco, San Diego, Los Angeles
NV Reno, Carson City, Las Vegas

Is this possible?

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-12-21 : 18:16:58
see http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81254


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -