测试:如下
select id,name,group_concat(hobby separator ‘,‘) as occu from test group by name

首先把hobby换成数字 方便测试 排序

select id,name,group_concat(hobby order by hobby asc separator ‘,‘) as occu from test group by name

select id,name,group_concat(hobby order by hobby desc separator ‘,‘) as occu from test group by name

select id,name,group_concat(distinct hobby order by hobby asc separator ‘,‘) as occu from test group by name

Mysql concat() group_concat()用法
标签:bsp tor obb lazy mic 排序 with 分隔符 图片