Table `names`
ID | name
---------
1 | Alex
2 | John
3 | Alex
4 | Alex
5 | Alice
6 | Monica
SELECT `name` FROM `names` GROUP BY `name`
Alex
John
Alice
MOnica
so, I need to make like this
SELECT `name`, COMBINE_STRING(`ID`, SEPARATOR `,`) AS `IDS` FROM `names` GROUP BY `name`
and the result should be like this :
and the result will be like this :
NAME | IDS
------------
Alex 1,3,4
John 2
Alice 5
MOnica 6
but as you see that mysql function COMBINE_STRING doesn't exist, so any ideas how to do this?