say i have the following table
id , emails 1, a@a.com 1, b@b.com 2, c@c.com 2, d@d.com
how can I write a select statement to ouput
1 a@a.com, b@b.com 2 c@c.com, d@d.com
SELECT id, GROUP_CONCAT_WS(', ', emails) AS email_list FROM table_name GROUP BY id