From: Tom Lane <tgl@sss.pgh.pa.us>
To: josh@agliodbs.com
Cc: A.M. <agentm@cmu.edu>
Cc: pgsql-sql@postgresql.org
Subject: Re: UNION and ORDER BY ... IS NULL ASC
Date: Fri, 04 Apr 2003 23:17:40 -0500
Message-ID: <11805.1049516260@sss.pgh.pa.us> (raw)
In-Reply-To: <200304041852.30121.josh@agliodbs.com>
References: <1E4E6631-670A-11D7-89FA-0030657192DA@cmu.edu>
<200304041852.30121.josh@agliodbs.com>
Josh Berkus <josh@agliodbs.com> writes:
>> ERROR: ORDER BY on a UNION/INTERSECT/EXCEPT result must be on one of
>> the result columns
> I do believe that this is per the SQL spec; UNIONs may only be sorted on the
> output columns.
Right. We extend the SQL spec for ORDER BY on simple selects, but we
have not gotten around to doing so for ORDER BY on set-operation
results. You can only sort by unadorned output columns.
Patches to improve this are welcome ;-)
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, josh@agliodbs.com, agentm@cmu.edu
Subject: Re: UNION and ORDER BY ... IS NULL ASC
In-Reply-To: <11805.1049516260@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox