Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Help : Order by with Union clause
Suman Mehta wrote:
>
> Can we write an Order by Clause at the end of a select statement
> having the Union clause in it ?
You may have an one order by clause after the last select and it cannot refer to the column(s) by name, but by number (position). For example:
select a, b, c
from table1
where this = 'GOOD'
union
select x, y, z
from table2
where that = 'OK'
order by 2, 3;
-- Tomm Carr ---- ---- Hunting for a job is like hunting for an elephant. If you're not *very* careful, you might find one!Received on Tue Aug 19 1997 - 00:00:00 CDT