In this blog post, you’ll learn more about the Sybase Error Invalid use of an aggregate function and the reason for receiving this error
Sybase SQL Error Message
Invalid use of an aggregate function
Reason for this Error
You attempted to use an aggregate function inappropriately. For example, a SELECT statement cannot contain an aggregate function within a predicate in the WHERE clause unless the aggregate function constitutes an outer reference. Other invalid uses include specifying an aggregate function in the SET clause of an UPDATE statement, or using an aggregate function in a CHECK constraint.