Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 6ADE09F9A92 for ; Mon, 13 Aug 2007 18:55:22 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 33600-01 for ; Mon, 13 Aug 2007 18:55:01 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from gwmta.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by postgresql.org (Postfix) with ESMTP id 3B35D9F99FB for ; Mon, 13 Aug 2007 18:55:00 -0300 (ADT) Received: from Courts-MTA by gwmta.wicourts.gov with Novell_GroupWise; Mon, 13 Aug 2007 16:54:59 -0500 Message-Id: <46C08CD6.EE98.0025.0@wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 7.0.2 Date: Mon, 13 Aug 2007 16:54:46 -0500 From: "Kevin Grittner" To: "olivier.boissard@cerene.fr" , Cc: "Steve Holdoway" Subject: Re: except command References: <46C099F6.8050002@cerene.fr> <46C0579F.EE98.0025.0@wicourts.gov> <20070814061358.d66d2cb3.steve.holdoway@firetrust.com> <46C05C0C.EE98.0025.0@wicourts.gov> <46C0CD72.5090407@cerene.fr> In-Reply-To: <46C0CD72.5090407@cerene.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/144 X-Sequence-Number: 26475 >>> On Mon, Aug 13, 2007 at 4:30 PM, in message <46C0CD72.5090407@cerene.f= r>, "olivier.boissard@cerene.fr" wrote:=20 > So it's like a filter on the first query Exactly; I think that sums it up better than anything I said. =20 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: =20 (a EXCEPT b) UNION ALL (b EXCEPT a) =20 or with: =20 (a UNION ALL b) EXCEPT (a INTERSECT b) =20 Of course, you could store the sets in temporary tables to get there = without generating from scratch each time, if that is expensive. =20 -Kevin =20