Loading

sql分组合并

select * from dbo.[User]

select sqr,stuff((select ','+rtrim(xdr)
from dbo.[User]
where sqr=a.sqr for xml path('')
),1,1,'') as [xdrs]
from (select distinct sqr from dbo.[User]) a

 

posted @ 2016-07-01 10:39  GerryGe  阅读(352)  评论(0编辑  收藏  举报