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

MySQL group_concat con clausola where

Puoi provare così.

SELECT     client.id, client.name, GROUP_CONCAT(module.name) AS modules
FROM       client
LEFT JOIN  client_module ON client_module.client_id = client.id
LEFT JOIN  module ON module.id = client_module.module_id
group by client.id Having Find_In_Set('module1',modules)>0 or Find_In_Set('module2',modules)>0

Demo di SQL Fiddle