select id,group_concat(re_id order by re_id separator ",") as re_idfrom tablenamegroup by idselect group_concat(list_name) from aa_list