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)
 Group and Concatenate

Author  Topic 

CVDpr
Starting Member

41 Posts

Posted - 2009-10-15 : 09:31:57
Hello there i have this table with this data and i want to group the ID1 and concatenate the ID2:

ID1 | ID2
------------
123 | 1
123 | 5
123 | 10
456 | 4
456 | 20


And i want to do a select like this:

ID1 | ID2
------------
123 | 1,5,10
456 | 4,20


Thanks.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-10-15 : 09:33:01
see
concatenate records without UDF
Rowset string concatenation: Which method is best ?


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

Go to Top of Page
   

- Advertisement -