question

Manvendra avatar image
Manvendra asked

String Aggregate Functions

Hi, I have some records like.. ID Name 1 ABC 1 FGT 1 VBU 2 HJU 2 JUI 3 KOP 3 LOP Now i want desired output like that in SQL SERVER 2005. 1 ABC,FGT,VBU 2 HJU,JUI 3 KOP,LOP Any help is really appreciated. Thanks
sql-server-2005sqlconcatenation
10 |1200 characters needed characters left characters exceeded

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

1 Answer

· Write an Answer
KenJ avatar image
KenJ answered
This is a pretty common problem. Here is a previous answer (you'll just use commas instead of semi-colons and change the column names from X and Y to ID and Name) [ http://ask.sqlservercentral.com/questions/3078/select-and-concatenate-easy][1] [1]: http://ask.sqlservercentral.com/questions/3078/select-and-concatenate-easy
10 |1200 characters needed characters left characters exceeded

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.