Mysql
 sql >> Database >  >> RDS >> Mysql

MySQL Seleziona la query per recuperare la base del record sui valori dell'elenco

Usa FIND_IN_SET() funzione:

Prova questo:

SELECT A.allocationId, 
       B.className, 
       GROUP_CONCAT(C.subjectShortName) AS subjectName
FROM subjectAllocation A
INNER JOIN class_Master B ON A.classId = B.classId 
INNER JOIN subject_Master C ON FIND_IN_SET(C.subjectId, A.subjectId) 
GROUP BY A.allocationId;