Re: [GENERAL] Need an explanation

2013-05-07 Thread Alan Nilsson
that was indeed the case. Did not think to look at that, thanks much for the kick :) alan On May 7, 2013, at 7:30 PM, Tom Lane wrote: > Alan Nilsson 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 t

Re: [GENERAL] Need an explanation

2013-05-07 Thread Tom Lane
Alan Nilsson 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 wan

[GENERAL] Need an explanation

2013-05-07 Thread Alan Nilsson
Could someone explain to me what I'm missing here. Given the following 3 queries: mqsql01.automation > select count(asp_id) from asps where asp_id>9 and asp_id not in (select asp_id from dasp where asp_id>1); count --- 84 (1 row) mqsql01.automation > select count(asp_id) from asp