Warren Little <wlittle@securitylending.com> writes:
> Look at the following two queries.
> ...
> and not exists (select pid from casecombo where casepid = secondpid)
> ...
> and casepid not in (select secondpid from casecombo)
> The second query is broken and I don't understand why.
I'll bet there are some NULL values for secondpid in casecombo.
The behavior of NOT IN with NULLs is fairly unintuitive :-(
regards, tom lane