|
Posted by Brian on 05/06/06 21:41
Hi all
I'm trying to write a statment that COUNTS the number of results in a table
(below is a cut down version of the full statment)
but it's not bring back the right results
daynumberscount1 should = the COUNT of number (number is a field name)
between the 2 timestamps where
banned (another field) is = to false
daybannednumbercount1 is the same as daynumberscount1 but banned is = to
true
SELECT COUNT(IF((`timestamp` BETWEEN 1146459600 AND 1146545999) AND
banned="false",`number`,0)) as daynumberscount1, COUNT(IF((`timestamp`
BETWEEN 1146459600 AND 1146545999) AND banned="true",`number`,0)) as
daybannednumbercount1 FROM table WHERE `x` = y
I can't see where i am going wrong??
Brian
Navigation:
[Reply to this message]
|