SQL LEFT JOIN return 0 rather than NULL
left-join, null, sql
Solution
Use:
ISNULL(count(*), 0)
Problem
I want to join two tables, with the number of records for each type being counted. If there are no records of that type in the left table I want a 0 to be returned, not a null. How can I do this?