I just tried this in MariaDB 10.5.10 on my personal blog database and it doesn't work. `post` <- many to many -> `tag`
With LEFT JOIN:
SELECT posts.title,
GROUP_CONCAT(tags.tag) AS tagarr
FROM posts
LEFT JOIN post_tags ON post_tags.post_id = posts.id
LEFT JOIN tags ON tags.tag_id = post_tags.tag_id
With WHERE:
SELECT posts.title,
GROUP_CONCAT(tags.tag) AS tagarr
FROM posts, post_tags, tags
WHERE posts.id *= post_tags.post_id
AND tags.tag_id *= post_tags.tag_id
It gives:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '= post_tags.post_id [...]