Aggregated expression '%1' contains multiple columns of which one or more are outer references
|ODBC 2 State
|ODBC 3 State
||The aggregated expression in error.
|Sybase error code
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.