A colleague asked me what was wrong with this query:

mysql> select user.id, email, count(click.id) as c from user, click
where when_signup >= '2002-11-10' and click.user_id = user.id group by
c;

ERROR 1056: Can't group on 'c'


Of course, it's logically impossible to group by the result of an
expression involving an aggregate function and my colleague certainly
knows better -- he just spaced out a bit.  That said, the error message
here wasn't useful in helping him to diagnose the problem.  It would
have been far more useful for the error message to be more clear about
*why* one cannot group on 'c'.

-JF


---------------------------------------------------------------------
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