hi,
i have a blog application were Post belongsTo Category and Category hasMany Post
Post can have a Category or not - in latter case NULL value is present in Post.category_id field.
Now i would like to have following category count with single SQL query
category|post_count
--------------
PHP | 2
JavaScript | 4
SomeOtherCat | 1
NULL | 3
The clue here is that i also want to count posts without category (NULL row above). Is it posibble with one SQL query?