select id,group_concat(re_id order by re_id separator ",") as re_id
from tablename
group by id
select group_concat(list_name) from aa_list
select id,group_concat(re_id order by re_id separator ",") as re_id
from tablename
group by id
select group_concat(list_name) from aa_list