一个小查询,在此记录下: 数据库字段和数据如下: 需要查询结果为: sql实现如下:使用GROUP_CONCAT函数 select A.name,GROUP_CONCAT(A.age) as age from test2 AS A GROUP BY A.name;