Received: from mickey.anpe.fr (smtp1.anpe.fr [195.101.137.20]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBS8kAL91655 for ; Thu, 28 Dec 2000 03:46:10 -0500 (EST) (envelope-from patrick.jacquot@anpe.fr) Received: from antivirus.anpe.fr ([10.0.4.95]) by mickey.anpe.fr (Netscape Messaging Server 4.05) with SMTP id G69SHG00.U0F for ; Thu, 28 Dec 2000 09:48:52 +0100 Message-ID: <3A4B0DE2.A93C02AD@anpe.fr> Date: Thu, 28 Dec 2000 10:54:43 +0100 From: patrick.jacquot@anpe.fr Organization: anpe X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.9-19mdk i586) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: Query Help References: <5.0.2.1.2.20001227111807.074dd2d0@pop.mindspring.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200012/274 X-Sequence-Number: 611 "Brian C. Doyle" wrote: > What do I have to do a query where information in table1 is not in table2 > > I am looking for something like > > Select table1.firstname where table1.firstname is not in table2.firstname > and table2.date='yesterday' > > I tried > Select table1.firstname where table1.firstname != table2.firstname and > table2.date='yesterday' > > and that did not work just listed everyone.... imho the most natrural way for what you need seems to be : select whatyouwant from table1 where not exists select * from table2 where table2.firstname = table1.firstname and table2.date='yesterday'; hoping that helps P. Jacquot