Re: Using NOT IN - Mailing list pgsql-novice

From Tom Lane
Subject Re: Using NOT IN
Date
Msg-id 6915.1062645770@sss.pgh.pa.us
Whole thread Raw
In response to Using NOT IN  (Juan Francisco Diaz <j-diaz@publicar.com>)
List pgsql-novice
Juan Francisco Diaz <j-diaz@publicar.com> writes:
> When i need it executed, the subquery returns 0 rows, maybe th if condition
> is false because the not in operator does not 'work' if there are 0 rows...

More likely, you have some null values in the sub-select.  NOT IN has
fairly unintuitive behavior in the presence of nulls.  See the manual.

            regards, tom lane

pgsql-novice by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: order by, but eliminating dupes
Next
From: Tom Lane
Date:
Subject: Re: Errors on restoring a 7.1.2 dump to 7.3.3