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: UNION ALL and ordering

Re: UNION ALL and ordering

From: Viktor Wiens <viktorww_at_arcor.de>
Date: Sat, 24 Nov 2007 09:50:13 +0100
Message-ID: <4747e5a2$0$4362$9b4e6d93@newsspool4.arcor-online.net>


> select 1, col1, col2, ... from table1 order by col2
> UNION ALL
> select 2, col1, col2, ... from table2 order by col3
> ORDER BY 1
>

?
select 1 u, col1, col2, ... from table1 order by col2 UNION ALL
select 2 u, col1, col2, ... from table2 order by col3 ORDER BY 1, DECODE (u, 1, col2, col3) Received on Sat Nov 24 2007 - 02:50:13 CST

Original text of this message

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