且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Postgres NOT IN(null)没有结果

更新时间:2023-11-25 21:51:52

(null)中的 [not]结果将始终为空。要与null进行比较,您需要 is [not] null is [not]与null

select *
from Entity this_ 
where this_.ID is not null

如果要 where(ID不在(1,null)中)可以做到

where ID is not null and ID not in (1)