Re: SELECT ... WHERE ... NOT IN (SELECT ...); - Mailing list pgsql-sql

From Tom Lane
Subject Re: SELECT ... WHERE ... NOT IN (SELECT ...);
Date
Msg-id 19392.1030109144@sss.pgh.pa.us
Whole thread Raw
In response to Re: SELECT ... WHERE ... NOT IN (SELECT ...);  (Yon Den Baguse Ngarso <yon@dugem.com>)
Responses Re: SELECT ... WHERE ... NOT IN (SELECT ...);  ("Ross J. Reedstrom" <reedstrm@rice.edu>)
List pgsql-sql
Yon Den Baguse Ngarso <yon@dugem.com> 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


pgsql-sql by date:

Previous
From: Andreas Tille
Date:
Subject: Updatable View (Was: Separating data sets in a table)
Next
From: "Ross J. Reedstrom"
Date:
Subject: Re: SELECT ... WHERE ... NOT IN (SELECT ...);