Left outer join with count not returning rows with 0 count
15:31 13 Aug 2012

I'm trying to return a simple list of all items in table A (groups) with a count of the corresponding number of users in column B (users_groups) and I can't figure out where I'm going wrong.

SELECT groups.gid, name, COUNT(uid) AS groupcount
FROM groups
LEFT OUTER JOIN users_groups ON groups.gid = users_groups.gid
WHERE aid = ?

I currently have two groups, one of which has three users. That row returns with the proper value in groupcount but I'm missing what should be the second row displayed with a 0 groupcount. Can anyone point me in the right direction? Thanks!

mysql