Answer the question
In order to leave comments, you need to log in
How to group MYSQL output separated by comma by column?
Good day!
There is the following request:
SELECT
`a`.`id` AS `projectId`,
`a`.`url` AS `projectUrl`,
`b`.`user` AS `access_users`
FROM `sites` AS `a`
LEFT JOIN `personal` AS `b` ON `b`.`project` = `a`.`id`
SELECT
`a`.`id` AS `projectId`,
`a`.`url` AS `projectUrl`,
GROUP_CONCAT(`b`.`user` SEPARATOR ',') AS `access_users`
FROM `l2_sites` AS `a`
LEFT JOIN `l2_personal` AS `b` ON `b`.`project` = `a`.`id`
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question