Illegal ORDER BY in aggregate function

Error constant SQLE_INVALID_ORDERBY_IN_AGGREGATE
ODBC 2 state 37000
ODBC 3 state 42000
Severity 15
SQLCODE -904
SQLSTATE 42W90
Sybase error code 13579
 Probable cause