I have the following MySQL code:
SELECT COUNT(e.eid) AS cnt, e.c_id, c.cdesc
FROM e
JOIN c on c.c_id = e.c_id
GROUP by c.c_id
Unfortunately the count does not take into account rows which are 0, so for example c_id may have 10 rows but only 9 are displayed (because one of the e_id‘s count is zero).
I have tried both LEFT JOIN and RIGHT JOIN with no success. Does anyone have any other suggestions?
I suspect that what you need is this: