select id,group_concat(distinct age) from test_group_concat group by id; select id,group_concat(id,'_', age SEPARATOR ';') from test_group_concat group by id;