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