ORDER BY in UNION query - Mailing list pgsql-general

From Antony Paul
Subject ORDER BY in UNION query
Date
Msg-id 2989532e0501100413665c136c@mail.gmail.com
Whole thread Raw
Responses Re: ORDER BY in UNION query
Re: ORDER BY in UNION query
List pgsql-general
Hi,
    I need to use ORDER BY clause in a UNION query and the Order BY
columns are not included in the SELECT statement. I tried like this

(select .... from a) UNION (select ..... from b) order by a.ename;

It says that
ERROR:  Attribute "ename" not found

How to do this.

rgds
Antony Paul

pgsql-general by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: handing created and updated fields
Next
From: Martijn van Oosterhout
Date:
Subject: Re: handing created and updated fields