On Sun, 2 Oct 2011 12:09:08 -0400, "Phil Hunt" <aaa (AT) aaa (DOT) com> wrote:
Quote:
How do I count a column that is NULL ? |
Hi Phil,
To count the number of NULL values in a column, use
SELECT SUM(CASE WHEN Column IS NULL THEN 1 ELSE 0 END) FROM YourTable;
--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis