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

Item Value
SQLCODE -962
Constant SQLE_INVALID_GROUPING_AGGREGATE
SQLSTATE 42WA7
Sybase error code 13527
ODBC 2 State 37000
ODBC 3 State 42000

Probable cause 

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