Home Forums SQL Server 2005 T-SQL (SS2K5) Count To Include Nulls RE: Count To Include Nulls
JestersGrind
SSCertifiable
Points: 5439
More actions
February 10, 2009 at 6:53 am
#941159
I would use a LEFT OUTER JOIN so that all results are returned regardless if they match or not. And then use ISNULL(COUNT(*), 0) AS 'Count' so that zeros are returned where there isn't any matching records.
Greg