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: dificult SQL

Re: dificult SQL

From: Michel Cadot <micadot_at_netcourrier.com>
Date: Tue, 9 Jan 2001 17:36:02 +0100
Message-ID: <93fenr$2dq$1@s1.read.news.oleane.net>

Put the "order by" clause out of the union:

      select customer,inc from table1
 UNION
      select customer,inc from table2
order by inc asc;

--
Have a nice day
Michel


<chemarey_at_my-deja.com> a écrit dans le message news: 93fc5f$r03$1_at_nnrp1.deja.com...

> Hi. I'd like to know how can i order the elements of a query with UNION.
>
> For example:
>
> select customer,inc from table1
> UNION
> select customer,inc from table2
>
> The idea is order by the inc item, but DBMS returns an error if a put
> the order by clause in the two different selects like
>
> select customer,inc from table1 order by inc asc
> UNION
> select customer,inc from table2 order by inc asc.
>
> Do you know if is possiblke to do this and how can i do.
>
> Thanks.
>
>
> Sent via Deja.com
> http://www.deja.com/
Received on Tue Jan 09 2001 - 10:36:02 CST

Original text of this message

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