Previous Topic: -60 - nnnn IS GREATER THAN MAXIMUM ALLOWABLE NUMBER OF COLUMNSNext Topic: -67 - COLUMN FUNCTIONS NOT ALLOWED IN WHERE CLAUSE OF QUERY


-66 - ILLEGAL NUMBER nnnn IN ORDER SPECIFICATION

Reason:

The integer specifying the ordinal position of the column in the result table of an ORDER BY clause has no corresponding item in the SELECT list.

The SQLSTATE that equates to this SQL return code is 42805.

Action:

Ensure that the SELECT list contains the proper number of items, so that the ORDER BY clause corresponds to a selected item.