;with roy as
(select 字段1,字段2,row=row_number()over(partition by 字段1 order by 字段老耐敏1) from Tab)
,roy2 as
(select 字段1,cast(字段2 as nvarchar(100))字段2,row from Roy where row=1
union all
select a.字段1,cast(b.字段2+','+a.字段2 as nvarchar(100)),a.row from Roy a join roy2 b on a.字段1=b.字侍枝段亩差1 and a.row=b.row+1)
select 字段1,字段2 from roy2 a where row=(select max(row) from roy where 字段1=a.字段1) order by 字段1 option (MAXRECURSION 0)