Re: problem with subselect: NOT IN - Mailing list pgsql-general

From Tom Lane
Subject Re: problem with subselect: NOT IN
Date
Msg-id 15325.986241275@sss.pgh.pa.us
Whole thread Raw
In response to problem with subselect: NOT IN  (Kevin L <kevinsl@yahoo.com>)
List pgsql-general
Kevin L <kevinsl@yahoo.com> writes:
> However, getting employees who have NOT sold something always
> returns zero rows:
> SELECT emp_id FROM employee WHERE emp_id NOT IN (SELECT emp_id
> FROM workorder);

Probably you have some NULL values in workorder.  See past discussions
about why NOT IN and NULL don't get along very well (it's not a bug).

            regards, tom lane

pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: problem with subselect: NOT IN
Next
From: "mike"
Date:
Subject: reindexing sequences