SELECT 编号
,STUFF((SELECT ','+名称 FROM tablename AS B WHERE a.编号=b.编号 FOR XML PATH('')),1,1'')
FROM tablename AS A
GROUP BY 编号