Eric February 2016
I think you can solve this by putting the inner select in an IsNull function.
Select id, name,
IsNull(SELECT COUNT(id) FROM posts
WHERE post.author = authors.id
GROUP BY author, 0) as post_num
ORDER BY post_num DESC
Basically if the first argument of the IsNull function is NULL, the second argument will be passed. If not, then the result of the firt argument will be passed.