我使用follown作为一部电影的页面
SELECT
`mt_films`.`Title1` AS `Title1`,
GROUP_CONCAT(DISTINCT `t_idiotita`.`idiotita`,
': ',
`t_people`.`person`
ORDER BY `t_idiotita`.`cnt_gr_id` ASC
SEPARATOR ' ') AS `kati`
FROM
((`t_people`
JOIN (`st_peoplefilms`
JOIN `mt_films` ON ((`mt_films`.`ID_films` = `st_peoplefilms`.`ID_films`))) ON ((`t_people`.`ID_person` = `st_peoplefilms`.`ID_person`)))
JOIN `t_idiotita` ON ((`st_peoplefilms`.`ID_idiotita` = `t_idiotita`.`ID_idiotita`)))
WHERE
((`st_peoplefilms`.`ID_idiotita` = 29)
OR (`st_peoplefilms`.`ID_idiotita` = 33)
OR (`st_peoplefilms`.`ID_idiotita` = 27)
OR (`st_peoplefilms`.`ID_idiotita` = 12)
OR (`st_peoplefilms`.`ID_idiotita` = 43)
OR (`st_peoplefilms`.`ID_idiotita` = 11)
OR (`st_peoplefilms`.`ID_idiotita` = 32)
OR (`st_peoplefilms`.`ID_idiotita` = 5)
OR (`st_peoplefilms`.`ID_idiotita` = 24)
OR (`st_peoplefilms`.`ID_idiotita` = 14))
GROUP BY `mt_films`.`Title1`
那返回例如
Title1 | Dir.: John | Script: Peter | Script: Anna | ...
Title2 | Dir.: George | Dir.: Paul | Script: Gus | ...
但是,虽然对于许多电影来说,同一专业不止一个人,但我需要第二个 group_concat 来对同一专业的所有人进行分组。我还需要两种不同的分离。第一个“:”分隔专业,第二个“,”人
预期结果
Title1 | Dir.: John | Script: Peter, Anna | ...
Title2 | Dir.: George, Paul | Script: Gus | ...
有什么帮助吗?