Good one, but I wouldn't settle for miscalculations being spat back at me from the system.
I was just working on a similar thing as a reference using subqueries, and this may not be pretty but very fast.
(4x12 ^ 2) * 80 entries gone through in 0.0020 seconds
SELECT `tid` , `c0` AS xc0, `c1` AS xc1, `tn` , `act` , (
SELECT `cname`
FROM `c0`
WHERE `c0` = xc0
LIMIT 1
) AS c0name, (
SELECT `cname`
FROM `c1`
WHERE `c0` = xc0
AND `c1` = xc1
LIMIT 1
) AS c1name
FROM `training`
WHERE `c0` = NULL
OR `c0` <3
ORDER BY `xc0` , `xc1` , `tid`
As you see from my own situation as an example, you should be able to do your count by 0, >0 and NULL posts without allowing for discrepencies in the resultset.
Also, you are not counting the fieldnames, so I recommend not to use count(*) as you then weed the whole set.
Only count your index fields at most to reduce server load.
Not tried this but wouldnt something like this do the same as what you need, without errors in sum total found?
(with reservation for typos -- been working for 29 hours straight)
-- find top posters
SELECT COUNT(`p`) AS `post_count`,
(SELECT `user_id` FROM `user` WHERE `posts`.`user_id`=`u`.`user_id`) AS `ugrp`
FROM `posts`
GROUP BY `ugrp`
ORDER BY `post_count` DESC;