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

From Kevin L
Subject problem with subselect: NOT IN
Date
Msg-id 20010402191045.38794.qmail@web9601.mail.yahoo.com
Whole thread Raw
Responses Re: problem with subselect: NOT IN
Re: problem with subselect: NOT IN
Re: problem with subselect: NOT IN
List pgsql-general
Hi.

here's my scenario: table employee has emp_id and employee
details. table salesorder has emp_id and sales details.

The following works fine: (get all employees who have sold
something)

SELECT emp_id FROM employee WHERE emp_id IN (SELECT emp_id FROM
salesorder);

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);

Has anyone encountered this before? I know the second query
should return something because the data is in the table.

thanks!

-Kevin

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/?.refer=text

pgsql-general by date:

Previous
From: will trillich
Date:
Subject: Re: function to operate on same fields, different records?
Next
From: Philip Hallstrom
Date:
Subject: Re: bitwise again