Received: from tech.com.au (IDENT:root@techpt.lnk.telstra.net [139.130.75.122]) by hub.org (8.9.3/8.9.3) with ESMTP id LAA00724 for ; Mon, 3 May 1999 11:02:30 -0400 (EDT) (envelope-from chris.bitmead@bigfoot.com) Received: from bigfoot.com (chris@localhost [127.0.0.1]) by tech.com.au (8.8.7/8.8.7) with ESMTP id BAA05706 for ; Tue, 4 May 1999 01:02:34 +1000 Sender: chris@tech.com.au Message-ID: <372DBA88.CCBD5EF3@bigfoot.com> Date: Mon, 03 May 1999 15:02:32 +0000 From: Chris Bitmead X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.0.36 i686) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgreSQL.org Subject: Re: [SQL] No DIVIDE Operator References: <372DA3DC.8EEAF089@zkm.de> <372DAFD5.FAA368B1@bigfoot.com> <372DB432.41A37050@zkm.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Joerg Fischer wrote: > > Chris Bitmead wrote: > > > > Isn't that what EXCEPT does? > > Maybe the operator is named differently between different database > systems. Anyway, as far as I am concerned, PGSQL lacks it. Or > (hopefully), am I wrong?? Well Postgres has EXCEPT. Is that what you want? > > Regards > > Joerg Fischer > > > chris=> create table foo (text text); > > CREATE > > chris=> insert into foo values('aaa'); > > INSERT 22153 1 > > chris=> insert into foo values('bbb'); > > INSERT 22154 1 > > chris=> insert into foo values('ccc'); > > INSERT 22155 1 > > chris=> select * from foo EXCEPT select 'aaa'; > > text > > ---- > > bbb > > ccc > > (2 rows) > > > > > If there would be a divide operator, I could write > > > > > > select name, prename from Person divide select name, prename from > > > Officer; > > > > > > without it, however, things get really complicated: > > > > > > select name, prename from Person where prename not in ( select prename > > > from Officer where Officer.name = Person.name ); > > > > > > This is an easy example. However, I have to deal with about 10 tables in > > > a corresponding way. > > > > > > Any better idea? Will there be a divide operator in PGSQL soon? > > > > > > Thanks! > > > > > > Regards > > > > > > Joerg Fischer -- Chris Bitmead http://www.bigfoot.com/~chris.bitmead mailto:chris.bitmead@bigfoot.com