SQLTeam.com | Weblogs | Forums

How to use GROUP BY to concatenate strings in SQL Server?


I have columns: ID, Name, Method.

There are different Names and different Method for each ID. I need to get Names and Methods listed in the same row for each ID, separated by comma. I work in MS SQL Server 2012.


Usually I use the XML PATH approach described on this page. Look for the section titled Black Box XML Methods on that page.