用sql server怎末实现呀
https://bbs.fanruan.com/thread-133002-1-1.html
SELECT 列1,GROUP_CONCAT(列2 SEPARATOR ',') FROM 表 GROUP BY 列1
试一试:
SELECT 列1, 列2=stuff( (select ','+列2 FROM city WHERE 列1 = c.列1 for xml path('')) ,1,1,'')FROM 表名 c group by 列1