时间:2021-07-01 10:21:17 帮助过:2人阅读
SELECT
group_concat(a.id ORDER BY a.create_date DESC separator ‘;‘) ids,
find_in_set(‘1‘,group_concat(a.paystatus)) pos
FROM
milk_parent_reserve a
WHERE
a.del_flag = ‘0‘
GROUP BY
a.weixin_id,
a.student_name
例3:分组,去重获取相关分组的所有id的值
SELECT
group_concat(distinct a.id) ids
FROM
milk_parent_reserve a
WHERE
a.del_flag = ‘0‘
GROUP BY
a.weixin_id,
a.student_name
MySql的group_concat函数的使用
标签:distinct from info weixin 使用 image create mamicode span