I have this query:
SELECT articles . *, article_tags.art_id, COUNT( article_tags.id ) AS appres, COUNT( article_comments.art_id ) AS comms
FROM articles
LEFT JOIN (
article_tags, article_comments
) ON ( article_tags.art_id = articles.id
AND article_comments.art_id = articles.id
AND article_tags.art_id = article_comments.art_id )
GROUP BY id
The simplified table structure is like
articles article_comments article_tags
--------- ---------------------- --------------
id id id
art_id art_id
If I left join just articles to comments or just articles to tags, it shows the correct count number. When I join both it completely messes up the number in no logical way to me.