Re: Need an explanation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alan Nilsson <anilsson(at)apple(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Need an explanation
Date: 2013-05-08 02:30:46
Message-ID: 10132.1367980246@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alan Nilsson <anilsson(at)apple(dot)com> writes:
> Could someone explain to me what I'm missing here.

Probably there are some NULLs in dasp.asp_id. NOT IN cannot succeed
when there are any nulls in the sub-select result: per SQL spec, the
outcome of such a test can only be FALSE or NULL. If that isn't the
behavior you want, try recasting the query to use NOT EXISTS.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alan Nilsson 2013-05-08 02:33:54 Re: Need an explanation
Previous Message Alan Nilsson 2013-05-08 01:53:47 Need an explanation