Re: except command - Mailing list pgsql-admin

From Kevin Grittner
Subject Re: except command
Date
Msg-id 46C08CD6.EE98.0025.0@wicourts.gov
Whole thread Raw
In response to Re: except command  ("olivier.boissard@cerene.fr" <olivier.boissard@cerene.fr>)
Responses Re: except command
List pgsql-admin
>>> On Mon, Aug 13, 2007 at  4:30 PM, in message <46C0CD72.5090407@cerene.fr>,
"olivier.boissard@cerene.fr" <olivier.boissard@cerene.fr> wrote:
> So it's like a filter on the first query

Exactly; I think that sums it up better than anything I said.

By the way, it does strike me as an odd omission that there is no set
operator in the ANSI standard to get you directly to the set of disjoint
elements.  With two datasets, a and b, you could always get there with:

(a EXCEPT b) UNION ALL (b EXCEPT a)

or with:

(a UNION ALL b) EXCEPT (a INTERSECT b)

Of course, you could store the sets in temporary tables to get there without
generating from scratch each time, if that is expensive.

-Kevin




pgsql-admin by date:

Previous
From: "Tena Sakai"
Date:
Subject: postmaster.pid file
Next
From: "olivier.boissard@cerene.fr"
Date:
Subject: Re: except command