Potresti provare quindi così:
Codice:
SELECT participant_contest, contest_name, COUNT (*)
FROM contest_participants RIGHT JOIN contests ON participant_contest = contest_id
GROUP BY participant_contest, contest_name
Se non funzionasse (perché ti conta per 1 anche i record con la parte sinistra a NULL), non puoi fare altro che estrarli manualmente con la UNION:
Codice:
SELECT participant_contest, contest_name, COUNT (*)
FROM contest_participants, contests
WHERE participant_contest = contest_id
GROUP BY participant_contest, contest_name
UNION SELECT contest_id, contest_name, 0
FROM contests
WHERE contest_id NOT IN (SELECT participant_contest FROM contest_participants)
(la query dovrebbe essere corretta, ma non credo MySQL 4 installato su AV supporti le query annidate).
Stammi bene...