The sentence is a HAVINGlittle hard to understand. I am not sure how MySQL interprets it. But the Postgres documentation can be found here:
http://www.postgresql.org/docs/9.0/static/sql-select.html#SQL-HAVING
It basically says:
HAVING , GROUP BY. , , GROUP BY. , SELECT HAVING . , HAVING , , .
, , HAVING GROUP BY SQL: 1999 "grand total", .. GROUP BY ( ) ( PostgreSQL)
, , HAVING .
, JOIN articles_categories articles:
SELECT DISTINCT c.*
FROM articles_categories c
JOIN articles a
ON a.active = TRUE
AND a.category_id = c.id
:
SELECT *
FROM articles_categories c
WHERE EXISTS (SELECT 1
FROM articles a
WHERE a.active = TRUE
AND a.category_id = c.id)