SELECT name , value = ( STUFF(( SELECT ',' + value FROM A WHERE name = Test.name FOR XML PATH('') ), 1, 1, '') ) FROM A AS Test GROUP BY name;
SELECT name , value = ( STUFF(( SELECT ',' + value FROM A WHERE name = Test.name FOR XML PATH('') ), 1, 1, '') ) FROM A AS Test GROUP BY name;