MDAC 2.5 SDK - ODBC Desktop Database Drivers
An aggregate function and a non-aggregate column reference cannot both be used as arguments to a single SQL statement.