Seaquel
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
Error3066
NameER_AGGREGATE_IN_ORDER_NOT_SELECT
SQLSTATEHY000
GroupServer errors

Source: MySQL 8.4 Error Reference