select a.id,stuff((select ‘,‘+[value] from tb as b where a.id=b.id for xml path(‘‘)),1,1,‘‘) [value] from tb as a group by a.id
行转列的处理。
原文:https://www.cnblogs.com/xyfy/p/9762140.html