Aggregated expression '%1' contains multiple columns of which one or more are outer references

Error constant SQLE_MULTIPLE_AGGREGATE_COLUMNS
ODBC 2 State 37000
ODBC 3 State 42000
Parameter 1 The aggregated expression in error.
Severity 15
SQLCODE –861
SQLSTATE 42W68
Sybase error code 13865
Probable cause

A subselect within the nested query contains an aggregate function whose parameters include an outer reference. In such cases, the outer reference must be the only column referenced in the expression.