Perhaps you should create a new table with an id column and a flag
Select the found calls > 5 or <= 5 into that new table and set the flag.
Then do a left join of your t_callog_calls table on the new table
selecting only the rows where the flag is NULL, these should be the rows
not found by either query.
Inspect the data in these rows manually to determine what is wrong.
> -----Original Message-----
> From: Richard Unger [mailto:runger@stripped]
> Sent: September 17, 2002 21:00
> To: mysql@stripped
> Subject: aggregate functions producing bad data
> My query:
> count( IF(call_end - call_start > 5, id, NULL) ),
> count( IF(call_end - call_start <= 5, id, NULL) )
> My result:
> However, 1956 + 35 != 1994.
> Running MySQL 3.23.49-nt