Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Why ORA-01785 ORDER BY item must be the number of a SELECT-list expression?
According to the SQL92 standard (and SQL89), the ORDER BY clause in UNION, UNION ALL, INTERSECT and MINUS type of queries, is used to sort the output of the query. One can specify both column names and integers to indicate columns. However, if the output columns are unnamed, you will have to use numbers. ORACLE does not have a way to name the output columns, hence the requirement to use numbers.
For more information about the SQL92 standard, have a look at the book "SQL Instant Reference" by Martin Gruber, published (in U.S.A.) by Sybex.
Hope this helps.
Michael Serbanescu