Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id A981E9F9949 for ; Mon, 13 Aug 2007 19:14:20 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 78855-06 for ; Mon, 13 Aug 2007 19:14:13 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mx.imatech.net (mx.imatech.net [81.255.215.253]) by postgresql.org (Postfix) with ESMTP id EC8449F991A for ; Mon, 13 Aug 2007 19:13:46 -0300 (ADT) X-AuthUser: olivier.boissard@cerene.fr Received: from [192.168.0.10] ([88.161.145.183]:3741) by mx.imatech.net with [XMail 1.23 ESMTP Server] id for from ; Tue, 14 Aug 2007 00:13:40 +0200 Message-ID: <46C0D794.3020105@cerene.fr> Date: Tue, 14 Aug 2007 00:13:40 +0200 From: "olivier.boissard@cerene.fr" User-Agent: Thunderbird 1.5.0.12 (Windows/20070509) MIME-Version: 1.0 To: Kevin Grittner , PostgreSQL Admin 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> <46C08CD6.EE98.0025.0@wicourts.gov> In-Reply-To: <46C08CD6.EE98.0025.0@wicourts.gov> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/145 X-Sequence-Number: 26476 Yes I noticed It was not an ANSI sql operator I think it's a good solution to spare temporay tables or result set I was searching a way to ease some réplication scripts but I don't think it will help me. It's better to use it to get a couple of records inside complex queries from many tables . Thanks for help Olivier Kevin Grittner a écrit : >>>> On Mon, Aug 13, 2007 at 4:30 PM, in message <46C0CD72.5090407@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 > > > > >