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:51:05 +0100
Message-ID: <4747e5d3$0$4362$9b4e6d93@newsspool4.arcor-online.net>


Viktor Wiens schrieb:

>> 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)
>

Sorry
select 1 u, col1, col2, ... from table1
UNION ALL
select 2 u, col1, col2, ... from table2
ORDER BY 1, DECODE (u, 1, col2, col3) Received on Sat Nov 24 2007 - 02:51:05 CST

Original text of this message

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