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

From Peter Eisentraut
Subject Re: problem with subselect: NOT IN
Date
Msg-id Pine.LNX.4.30.0104022154020.1287-100000@peter.localdomain
Whole thread Raw
In response to problem with subselect: NOT IN  (Kevin L <kevinsl@yahoo.com>)
List pgsql-general
Kevin L 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);

Are there any NULL values in workorder.emp_id?  If so, you need to exclude
them (... FROM workorder WHERE emp_id IS NOT NULL).

--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


pgsql-general by date:

Previous
From: Patrik Kudo
Date:
Subject: Re: problem with subselect: NOT IN
Next
From: Tom Lane
Date:
Subject: Re: problem with subselect: NOT IN