mysql分组后将同组多行记录的某个字段合并成一条记录的某个字段,中间用逗号分开
select ID,group_concat(NAME) as NAME from table group by ID;
select ID,group_concat(NAME SEPARATOR ';') as NAME from table group by ID;
select ID,group_concat(NAME) as NAME from table group by ID;
select ID,group_concat(NAME SEPARATOR ';') as NAME from table group by ID;