SELECT Class,STUFF( ( SELECT ','+ Name FROM a b
WHERE b.Class = a.Class FOR XML PATH('')),1 ,1, '') Name
FROM a a GROUP BY Class
转载于:https://www.cnblogs.com/AlexLeeLi/p/9644548.html
SELECT Class,STUFF( ( SELECT ','+ Name FROM a b
WHERE b.Class = a.Class FOR XML PATH('')),1 ,1, '') Name
FROM a a GROUP BY Class
转载于:https://www.cnblogs.com/AlexLeeLi/p/9644548.html