Re: Help : Order by with Union clause

From: Maciek Iwaniuk <iwaniuk_at_worldnet.att.net>
Date: 1997/08/19
Message-ID: <33FA490C.8B97B2B1_at_worldnet.att.net>#1/1


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 CEST

Original text of this message