Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

MySQL Junte duas tabelas com valores separados por vírgula

SELECT  a.nid,
        GROUP_CONCAT(b.name ORDER BY b.id) DepartmentName
FROM    Notes a
        INNER JOIN Positions b
            ON FIND_IN_SET(b.id, a.forDepts) > 0
GROUP   BY a.nid