Re: BUG #13501: Bug with subqueries in WHERE clause - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #13501: Bug with subqueries in WHERE clause
Date
Msg-id 5211.1436974100@sss.pgh.pa.us
Whole thread Raw
In response to BUG #13501: Bug with subqueries in WHERE clause  (me@egidiocaprino.it)
List pgsql-bugs
me@egidiocaprino.it writes:
> This query returns no record

> select *
> from merge.organization
> where school_id not in (select school_id from merge.account)
> or school_id not in (select school_id from merge.sd3_hierarchy)

This usually means that you've got NULLs in the school_id column.
NOT IN never returns true if there are any nulls in the sub-select result.
This is per SQL standard.

            regards, tom lane

pgsql-bugs by date:

Previous
From: 田中 翔太
Date:
Subject: 9.4.4 max_wal_sendersについて
Next
From: Andrew Gierth
Date:
Subject: Re: [HACKERS] Grouping Sets: Fix unrecognized node type bug