MySQL Group_Concat Repeating Values

后端 未结 1 949
夕颜
夕颜 2020-12-10 14:05

I am working on an open source project called PHP-Bouncer, and I\'m having issues with a MySQL Query I am writing for it. Basically we have three tables: BouncerRoles, PageI

相关标签:
1条回答
  • 2020-12-10 14:39

    You are probably joining a table with two tables on 1..n relationships, producing duplicate results.

    • Use either GROUP_CONCAT( DISTINCT ...) or

    • Use two subqueries: in each one use GROUP_CONCAT() with group by on each of the 2 tables. Then join the two subqueries and the main table.

    0 讨论(0)
提交回复
热议问题