MySQL function group_concat is a powerful tool to concat strings using a custom sperator :
GROUP_CONCAT([DISTINCT] expr [,expr ...]
[ORDER BY {unsigned_integer | col_name | formula} [ASC | DESC] [,col ...]]
[SEPARATOR str_val])
But sometimes the execution result may be truncated because of mysql default setting, so in this case "group_concat_max_len" haveto be changed to a bigger value
SET [GLOBAL | SESSION] group_concat_max_len = val;