Re: SELECT ... WHERE ... NOT IN (SELECT ...);

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: yon(at)dugem(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: SELECT ... WHERE ... NOT IN (SELECT ...);
Date: 2002-08-23 13:25:44
Message-ID: 19392.1030109144@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Yon Den Baguse Ngarso <yon(at)dugem(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Ross J. Reedstrom 2002-08-23 15:01:34 Re: SELECT ... WHERE ... NOT IN (SELECT ...);
Previous Message Andreas Tille 2002-08-23 10:00:12 Updatable View (Was: Separating data sets in a table)