Re: problem with subselect: NOT IN

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kevin L <kevinsl(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: problem with subselect: NOT IN
Date: 2001-04-02 19:54:35
Message-ID: 15325.986241275@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Kevin L <kevinsl(at)yahoo(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2001-04-02 19:55:23 Re: problem with subselect: NOT IN
Previous Message Richard Huxton 2001-04-02 19:44:44 Re: What could be the reason for EXTREMELY slow INSERTs?