本文介绍使用SELECT语法时,not in中包含了null,结果全为真的场景。 teledb=# select * from teledb_pg where id not in (1,3); id | nickname ----+---------- 2 | TELEDB 4 | (2 rows) teledb=# select * from teledb_pg where id not in (1,3,null); id | nickname ----+---------- (0 rows)
本文介绍使用SELECT语法时,not in中包含了null,结果全为真的场景。 teledb=# select * from teledb_pg where id not in (1,3); id | nickname ----+---------- 2 | TELEDB 4 | (2 rows) teledb=# select * from teledb_pg where id not in (1,3,null); id | nickname ----+---------- (0 rows)
本文介绍使用SELECT语法时,not in中包含了null,结果全为真的场景。 teledb=# select * from teledb_pg where id not in (1,3); id | nickname ----+---------- 2 | TELEDB 4 | (2 rows) teledb=# select * from teledb_pg where id not in (1,3,null); id | nickname ----+---------- (0 rows)