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 17,953 of 19,505   
   tshad to Andrew Morton   
   Re: Common Table Expression slow   
   19 Oct 10 16:25:25   
   
   From: tfs@dslextreme.com   
      
   "Andrew Morton"  wrote in message   
   news:8i51eeF9e6U1@mid.individual.net...   
   > tshad wrote:   
   >> WHERE (@Status = 'ALL') OR ((@Status <> 'ALL') AND (dStart = (Select   
   >> ...   
   >   
   > Unless my brain deceives me at this early hour,   
   > A OR (NOT A AND B) is the same as A OR B.   
   >   
      
   In "A" all the records will be processed.  But you only want B processed if   
   "Not A".   
      
   However, you may be correct since the 2nd one would not even be looked at if   
   @Status = 'All' and would if @Status was not equal to "All".   
      
   However, I think it is a little clearer if the 2nd criteria is there.   
      
   Thanks,   
      
   Tom   
   > --   
   > Andrew   
   >   
   >   
      
   --- 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