行转列的处理。

  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