MySQL error code
MySQL error 3066
MySQL server error 3066 is ER_AGGREGATE_IN_ORDER_NOT_SELECT, reported with SQLSTATE HY000.
Expression #%u of ORDER BY clause is not in SELECT list, contains aggregate function; this is incompatible with %s
| Error | 3066 |
|---|---|
| Name | ER_AGGREGATE_IN_ORDER_NOT_SELECT |
| SQLSTATE | HY000 |
| Group | Server errors |
Source: MySQL 8.4 Error Reference