I have a query with a count/group by - If no person with the name 'Bob' is found then it returns no rows at all because the GROUP BY is on an empty set - null is returned for the count - I'd like to change the behaviour so that count returns 0 and not null.
select p.Id as personId, count(*) as alias1 from
Table1 as alias2
join Table2 as alias3 on alias3.personId = alias1.Id
where Name = 'Bob'
group by p.Id