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 2005 Forums
 Transact-SQL (2005)
 Concatenate Values from Rows

Author  Topic 

dnf999
Constraint Violating Yak Guru

253 Posts

Posted - 2007-12-10 : 10:18:22
Hi

I have a table. i.e:

ID Value
1 hello
2 bye
1 morning
1 Hi
2 Cya

And i need to return the follwing:

ID Values
1 hello; morning; cya
2 bye; Cya

Please can anybody recommend how I do this?

I need an example on running this for a whole table to concantenate all the values for the Unique ID's

Thanks!

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-12-10 : 10:20:42
http://sqlblog.com/blogs/adam_machanic/archive/2006/07/12/rowset-string-concatenation-which-method-is-best.aspx
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81254


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

Go to Top of Page
   

- Advertisement -