Hi,

I had some private e-mail suggesting that MAX functions should apply to 
the full table - as it is the maximum value of the field- and this is why 
HAVING clause behaved in that manner.
   I'm sure this is not the case since MAX does obey (as it should) 
WHERE clause in the query.
  To prove my point I've decided to use another data set as example: 

        create table tt (f1 int, f2 int);
        insert into tt values(1,1);
        insert into tt values(1,2);
        insert into tt values(2,3);
        insert into tt values(1,4);

select f2 from tt where f1=1 having f2=max(f2);
Empty set (0.00 sec)

        You draw the conclusions.

Regards,

Gabriel


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to