SQL/MP Messages Manual

SQL Compiler Normalizer Messages (5000 to 5999)
HP NonStop SQL/MP Messages Manual427720-006
7-9
SQL 5032
Cause. If the ordering column is specified as the argument of a function or as a part of
an expression, but is not explicitly specified in the select list of the first SELECT
statement, the SQL compiler considers the column reference to be ambiguous.
Effect. The statement does not compile.
Recovery. If the column is not specified in the select list, consider adding the column
to the list. If you want to order items according to the value of an expression, use an
integer denoting the column's ordinal position in the select list.
SQL 5033
Cause. During a grouping operation, columns are ignored if they are not grouping
columns, or if they do not occur as arguments of aggregate functions in the select list.
Such columns cannot, therefore, be used for ordering. If the ordering column is an
argument of a function and is not specified explicitly in the select list, the column is
considered to be an ambiguous reference.
Effect. The statement does not compile.
Recovery. If the ordering column does not occur in the select list, remove the column.
If the ordering is desired according to the value of an aggregate function, an integer
denoting its ordinal position in the select list should be used instead.
5032 The ORDER BY clause for a union of SELECT statements can
only reference a column from the select list of the first
SELECT statement. The column must be specified independently
in that select list. If the column is specified as the
argument of a function or as a part of an expression, but is
not specified independently, then the column cannot be
specified in the ORDER BY clause.
5033 When a SELECT statement contains a GROUP BY or a HAVING
clause you can only ORDER BY a grouping column.