Background documentation-8013: Order column must be output column Locate this document in the navigation structure

 

Explanation
  1. Only column names which are also specified as select column can be specified in the ORDER clause of a QUERY statement with DISTINCT specification.

  2. If column numbers are specified, it must be ensured that this number is not greater than the number of specified output columns.

  3. The number of output columns may have decreased in case of a SELECT * as a result of an ALTER TABLE statement with DROP definition.

User Response
  1. Do not use the DISTINCT specification or specify the column of the ORDER clause in a select column.

  2. Correct the number in the ORDER clause accordingly.