Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id A0F29475A19 for ; Thu, 29 Aug 2002 02:14:59 -0400 (EDT) Received: from omta01.mta.everyone.net (sitemail3.everyone.net [216.200.145.37]) by postgresql.org (Postfix) with ESMTP id 2BED0475806 for ; Thu, 29 Aug 2002 02:14:59 -0400 (EDT) Received: from sitemail.everyone.net (dsnat [216.200.145.62]) by omta01.mta.everyone.net (Postfix) with ESMTP id 31D641C59C1; Wed, 28 Aug 2002 23:14:59 -0700 (PDT) Received: by sitemail.everyone.net (Postfix, from userid 99) id 0BBB03954; Wed, 28 Aug 2002 23:14:59 -0700 (PDT) Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Mime-Version: 1.0 X-Mailer: MIME-tools 5.41 (Entity 5.404) Date: Wed, 28 Aug 2002 23:14:58 -0700 (PDT) From: Yon Den Baguse Ngarso To: Tom Lane , yon@dugem.com Cc: pgsql-sql@postgresql.org Subject: Re: SELECT ... WHERE ... NOT IN (SELECT ...); Reply-To: yon@dugem.com X-Originating-Ip: [202.152.37.244] Message-Id: <20020829061459.0BBB03954@sitemail.everyone.net> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/409 X-Sequence-Number: 9255 O, Yes... The problem occure because of null from selecting into tbl2. I have to delete record which eventid=null, and the result become correct. Pls be carefull with Null entri when using NOT IN. Thanks for you all :-) Regards, -Yon- --- Tom Lane wrote: >Yon Den Baguse Ngarso writes: >> If i create tbl1 & tbl2, and then load it with the data. >> The result is CORRECT. Like yours. >> But, if the data loaded from another table, the result become WRONG/ null record. > >Do you have any nulls in what you are selecting into tbl2? >The behavior of NOT IN with nulls is not very intuitive. > > regards, tom lane _____________________________________________________________ Get yourname@dugem.com at http://www.dugem.com _____________________________________________________________ Promote your group and strengthen ties to your members with email@yourgroup.org by Everyone.net http://www.everyone.net/?btn=tag