Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Help : Order by with Union clause

Re: Help : Order by with Union clause

From: Tomm Carr <carr%tw_at_edwards.af.mil>
Date: 1997/08/19
Message-ID: <33FA3B9D.25C4@edwards.af.mil>#1/1

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US