I\'m using Postgres with this query
select
*
from Entity this_
where
(this_.ID not in (null))
Why does this give me no results? I would expe
PostgreSQL uses NULL as undefined value.
What you're asking is to return the items that are not in a list or an undefined value. Since undefined means that you do not know what's inside, PostgreSQL does not return any item because simply can not respond to the request.
While the request:
select * from Entity where id in (1, null)
can return the records, because if it finds an element with ID = 1 knows that is in the collection
the request:
select * from Entity where (ID not in (1, null))
can not be satisfied because the null value can be any value.