Re: INTERSECT AND ORDER BY - Mailing list pgsql-general

From Tom Lane
Subject Re: INTERSECT AND ORDER BY
Date
Msg-id 3084.992467873@sss.pgh.pa.us
Whole thread Raw
In response to INTERSECT AND ORDER BY  (Gary DeSorbo <isasitis@uchicago.edu>)
List pgsql-general
Gary DeSorbo <isasitis@uchicago.edu> writes:
> I am trying to use the query below:
> SELECT date_worked, hours_worked
> FROM hours
> WHERE date_worked < '8/15/2001'
> INTERSECT
> SELECT date_worked, hours_worked
> FROM hours
> WHERE date_worked > '8/8/2001'
> ORDER BY date_worked

> but Postgres does not seem to like the ORDER BY     clause.

Ignoring the fact that this is a tremendously inefficient way to do it
(cf. Bruno Wolff's response nearby), it should have worked.  At least
in 7.1, I don't see a problem.  Before 7.1 INTERSECT and EXCEPT had
some limitations ...

            regards, tom lane

pgsql-general by date:

Previous
From: "Andy Samuel"
Date:
Subject: Re: Vacuum-ing without disconnecting users
Next
From: Lamar Owen
Date:
Subject: Re: Log files, how to rotate properly