group_concat用法
默认中间是用‘,’分割的
SELECT fa.id,fa.act_title,fs.min_rank,fs.max_rank,fa.`status`,
group_concat(fs.award_ids),
group_concat(CONCAT(CONCAT('第',fs.min_rank,IF(fs.max_rank is NULL,'名',CONCAT('—',fs.max_rank,'名'))),fs.award_names)),
fa.create_date
FROM f_rank_act_set fs LEFT JOIN f_rank_act fa ON fs.act_id = fa.id GROUP BY fa.act_title ORDER BY fa.id,fs.min_rank;
如果想用自定义的分割符分割可以用
REPLACE(group_concat(vaccine_name),',','自定义分隔符')