 <p>Your problem is not occuring at the GROUP BY level, but rather in the JOIN. The rows with a NULL qualifier cannot be JOINed and, because you're using INNER JOIN, they fall out of the result set.</p> <p>Use LEFT OUTER JOIN to see all the rows.</p>