This question already has an answer here:
Hi my original data is as below
Id | Value
-----+------
0001 | IN
0001 | ME
0001 | OH
0001 | ON
0002 | AC
0002 | ON
0002 | VI
0002 | ZO
0003 | ME
0003 | OO
0003 | PS
0003 | QA
Wanted to get the Data in
Id | Value
-----+------
0001 | IN,ME,OH,ON
0002 | AC,ON,VI,ZO
0003 | ME,OO,PS,QA
in SQL server 2008
This will work :
Output:
See Demo