Will Tomlinson wrote:
> And what I can't figure out is why this: 
> 
>  COUNT(EAR.answerID) AS numAnswers 
> 
> would produce values of 1 for rows in which it should be 0. 

Because you are using MySQL and MySQL has broken grouping. Your 
statement is invalid SQL and the database should throw an error, but 
MySQL pretends to know what you want and gives you back some random 
data. Put every field from the select that is not an aggregate in your 
group by and you get something understandable.

Jochem

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion?sdid=RVJW

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:273236
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to