34,838
社区成员




with a as (
select td004,td010 from t1 where td004 in ( select td004 from t1 group by td004 having count(distinct td010)=2) )
select distinct td004,td010=stuff((select ','+ cast(td010 as varchar(max)) from a where a.td004=b.td004 for xml path ('') ),1,1,'') from a b