Previous Topic: -84 - ORDER BY ITEMS MUST BE CONSTANTS FOR UNION OF QUERIESNext Topic: -86 - NULL NOT ALLOWED IN COLUMN aaaa


-85 - ORDER BY MUST FOLLOW ALL QUERIES WHEN PERFORMING A UNION

Reason:

When performing a union, you cannot specify an ORDER BY on any of the subselects. You can only order the results of the union.

The SQLSTATE that equates to this SQL return code is 53S07.

Action:

Remove the ORDER BY or move it to the end of the query specification. ORDER BY is part of the cursor and comes after the query specification.