List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:January 10 2003 9:51pm
Subject:Re: count(expr)
View as plain text  
>On Thu, Jan 09, 2003 at 12:24:28PM -0600, Paul DuBois wrote:
>...
>>  You probably want SUM(col3 < col4,1,0) instead.
>
>   Hey Paul,
>
>   Am I missing something here?
>
>   I did not think that SUM(col3 < col4,1,0) would be valid syntax?
>
>
>   Cheers!
>--
>  Zak Greant <zak@stripped> | MySQL Advocate |  http://zak.fooassociates.com

Zak's correct.  I erred.  The expression would use IF() inside a SUM():

     SUM(IF(col3 < col4,1,0))


Sheesh.
Thread
count(expr)Meena Vyavahare9 Jan
  • Re: count(expr)Paul DuBois9 Jan
  • Re: count(expr)Keith C. Ivey9 Jan
Re: count(expr)Paul DuBois10 Jan