Invalid ORDER BY specification

Error constant SQLE_INVALID_ORDER
ODBC 2 State 37000
ODBC 3 State 42000
Severity 15
SQLCODE –152
SQLSTATE 53005
Sybase error code 108
Probable cause

Either you used an integer in an ORDER BY list and the integer is larger than the number of columns in the select list, or you specified an ORDER BY expression that is semantically invalid. For example, with UNION queries you can only use integers to specify an ordering of the result.