Received: from bologna.nettuno.it (bologna.nettuno.it [193.43.2.1]) by hub.org (8.9.3/8.9.3) with ESMTP id MAA09473 for ; Fri, 11 Jun 1999 12:39:45 -0400 (EDT) (envelope-from jose@sferacarta.com) Received: from proxy.sferacarta.com (mail@sfcabop1.nettuno.it [193.207.10.213]) by bologna.nettuno.it (8.8.6/8.8.8/NETTuno 3.2) with ESMTP id SAA15852; Fri, 11 Jun 1999 18:39:29 +0200 (MDT) Received: from rosso.sferacarta.com (sferacarta.com) [10.20.30.5] by proxy.sferacarta.com with esmtp (Exim 2.05 #1 (Debian)) id 10sVTc-00048A-00; Fri, 11 Jun 1999 17:52:24 +0000 Message-ID: <37613010.5EBF725C@sferacarta.com> Date: Fri, 11 Jun 1999 17:49:36 +0200 From: =?iso-8859-1?Q?Jos=E9?= Soares X-Mailer: Mozilla 4.5 [it] (Win95; I) X-Accept-Language: it MIME-Version: 1.0 To: "Brett W. McCoy" CC: pgsql-sql@postgresql.org Subject: Re: [SQL] unmatched References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit prova=> select * from prova1; a1 ----- delta alpha gamma (3 rows) prova=> select * from prova2; a2 ----- delta gamma (2 rows) prova=> select * from prova1 where a1 not in (select * from prova2); a1 ----- alpha (1 row) "Brett W. McCoy" ha scritto: > I seem to have a serious brain fart going here. I have two tables, and > I want to find out which rows that are in the first do not have a match > in the second. If I could create an explicit left join, I could do it by > finding the rows in the second column that are NULL. Here's what I kinda > have, but itjust sits there and never returns anything: > > select count(*) from apdf > where apdf.doc_index != ondisk.doc_index; > > I tried the NOT IN operator (!!=), but it didn't like that at all. Is != > a valid operator? > > Brett W. McCoy > http://www.lan2wan.com/~bmccoy > ----------------------------------------------------------------------- > "Biology is the only science in which multiplication means the same > thing as division." ______________________________________________________________ PostgreSQL 6.5.0 on i586-pc-linux-gnu, compiled by gcc 2.7.2.3 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Jose'