ORDER BY in UNION query - Mailing 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