Re: Select .... where id not in (....) returns 0 incorrectly

From: Ravi Krishna <srkrishna(at)vivaldi(dot)net>
To: "J(dot) Roeleveld" <joost(at)antarean(dot)org>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Select .... where id not in (....) returns 0 incorrectly
Date: 2022-04-04 12:44:15
Message-ID: 2ddba2d73d0d54da3396ff2dad9e7d2d@vivaldi.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> select count(1) from snapshotlist where id not in (select id from q);
> count
> -------
> 0
> (1 row)

Doesn't this usually happen if q.id contains NULL. That is as per ANSI
standard.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeremy Smith 2022-04-04 12:50:44 Re: Select .... where id not in (....) returns 0 incorrectly
Previous Message Sebastien Flaesch 2022-04-04 12:41:36 Re: Transaction and SQL errors