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,475 of 19,505    |
|    phil hunt to Bob Barrows    |
|    Re: SQL help again    |
|    02 Oct 11 18:44:03    |
   
   XPost: microsoft.public.sqlserver.programming   
   From: a@abc.com   
      
    That's it.Thanks.   
      
      
   "Bob Barrows" wrote in message   
   news:j6a5n5$9d3$1@dont-email.me...   
   > Phil Hunt wrote:   
   >> I tried   
   >> CASE EventID when NULL then 1 else 0 end   
   >>   
   >> It always return 0, why ?   
   >>   
   >>   
   > Because the way you have the statement structured is causing an equality   
   > comparison to be performed, the result of which will always be false. You   
   > have to structure it like:   
   >   
   > CASE when EventID IS NULL then 1 else 0 end   
   >   
   > To answer your original question, you can subtract the result of   
   > count(distinct column_name) from count(*):   
   >   
   > select count(*) - count(distinct eventid) as null_eventids   
   >   
   >   
   >   
   >   
      
   --- 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