Argument to GROUPING aggregate must be a grouping column in the GROUP BY clause

Error constant SQLE_INVALID_GROUPING_AGGREGATE
ODBC 2 State 37000
ODBC 3 State 42000
Severity 15
SQLCODE –962
SQLSTATE 42WA7
Sybase error code 13527
Probable cause

Only a grouping column is permitted as an argument to the GROUPING aggregate function. An argument that contains anything other than a single grouping column expression will not be accepted.