SELECT rowid,GROUP_CONCAT(labelname ORDER BY labelname SEPARATOR ", ") AS re_name FROM recordLabel GROUP BY groupid;