Re: [GENERAL] unexpected results with NOT IN query

2008-03-20 Thread Mason Hale
Thanks -- that was it -- last_feed_download_task_id can indeed be null. - Mason On Thu, Mar 20, 2008 at 10:17 AM, Stephan Szabo < [EMAIL PROTECTED]> wrote: > On Thu, 20 Mar 2008, Mason Hale wrote: > > > Hello -- > > > > I'm getting some unexpected results with a NOT IN query -- this is on > 8.2.

Re: [GENERAL] unexpected results with NOT IN query

2008-03-20 Thread Stephan Szabo
On Thu, 20 Mar 2008, Mason Hale wrote: > Hello -- > > I'm getting some unexpected results with a NOT IN query -- this is on 8.2.5. > > This is the query in question: > > prod_2=> select id from feed_download_task where id in (02466,141701504) > and id not in (select last_feed_download_task_id

Re: [GENERAL] unexpected results with NOT IN query

2008-03-20 Thread Tom Lane
"Mason Hale" <[EMAIL PROTECTED]> writes: > I'm getting some unexpected results with a NOT IN query -- this is on 8.2.5. If there are any NULLs in subscription.last_feed_download_task_id, that NOT IN will not behave the way you are expecting. You might want to filter the nulls out of the subselect

[GENERAL] unexpected results with NOT IN query

2008-03-20 Thread Mason Hale
Hello -- I'm getting some unexpected results with a NOT IN query -- this is on 8.2.5. This is the query in question: prod_2=> select id from feed_download_task where id in (02466,141701504) and id not in (select last_feed_download_task_id from subscription); id (0 rows) This query re