Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Help : Order by with Union clause
the following statement:
1> select a, b, c 2> from Table1 3> UNION 4> select a, b, 0 5> from Table2 6> ORDER BY c
will give you an error (is that your problem??)
to fix it replace the 6th line with:
6> ORDER by 3 -- where 3 is number of column to be sorted.
Hope it help.
Maciek Iwaniuk
Suman Mehta wrote:
> Can we write an Order by Clause at the end of a select statement
> having the Union clause in it ?
>
> My SQL query (which has a union clause) works fine without
> it but gives an error message when I try to order by
> one of the columns.
>
> How do we overcome this problem ?
>
> ----------------------------------------------
> Suman Mehta
> E-mail ID : sumanp_at_yardi.com
Received on Tue Aug 19 1997 - 00:00:00 CDT