home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 18,470 of 19,505   
   Hugo Kornelis to Phil Hunt   
   Re: SQL help   
   02 Oct 11 19:52:54   
   
   XPost: microsoft.public.sqlserver.programming   
   From: hugo@perFact.REMOVETHIS.info.INVALID   
      
   On Sun, 2 Oct 2011 12:09:08 -0400, "Phil Hunt"  wrote:   
      
   >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   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca