Answer the question
In order to leave comments, you need to log in
There are duplicates when querying GROUP_CONCAT, how to get rid of them?
Here is the request itself, it works correctly
SELECT p.*, GROUP_CONCAT(s.sectionId) as "sections", GROUP_CONCAT(t.tagId) as "tags" FROM products AS p
LEFT JOIN sections AS s ON p.id = s.productId
LEFT JOIN tags AS t on p.id = t.productId
GROUP BY p.id, p.name
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question