group by,其他用逗号合并
select id, name=stuff((select ','+name from #test where id=t.id for xml path('')),1,1,'') from #test t group by id