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