It doesn't work because you are counting values. An empty string is still a value. Perhaps you are trying to SUM instead? If you are really looking for a count, you also should use sum.

sum(if(a.Type = "Signature Based Return", 1,0))

That will return a count of those records where a.Type = "Signature Based Return".

Brent

On Sep 23, 2008, at 9:29 PM, kalin m wrote:


hi all...

can somebody explain why a conditional count like this one doesn't work:

count(if(a.Type = "Signature Based Return", a.amount,'')).... group by.... order by....
or
if(a.Type = "Signature Based Return", count(a.amount),'') .... group by.... order by...


thanks...

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to