Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> ORDER BY With Set Operators
In 9iR2, when we use ORDER BY with SET operators(UNION/UNION
ALL/INTERSECT/MINUS), the naming rules is very confusing and appreciate if
anyone can clarify:
According to SQL Reference:
By personal testing with 9iR2:
and 'order by colname' => error
2. if there is only 1 SET operator, we can use names instead of position so
long as the number and type of the 2 select list columns are matching:
select col1, col2 from a UNION ALL
select a,b,c from b
order by col1 okay
So, why the difference? Which rule should we follow? Received on Mon Feb 28 2005 - 06:18:52 CST