--sql server的写法 SELECT name, STUFF((SELECT','+ convert(VARCHAR(200),address) FROM [TableName] WHERE name=V.name FOR XML PATH('')),1,1,'') AS Newaddress, MAX(arrive_time) AS Maxtime FROM [TableName] V GROUP BY name