postgresql  null 值 不受查询条件约束

Posted ljtyxl

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了postgresql  null 值 不受查询条件约束相关的知识,希望对你有一定的参考价值。

postgresql  null 值 不受查询条件约束

postgresql null 值 不受查询条件约束

 

select count(1) cnt from dm.algo_m_gg_1_prt_qycg_ebs_shasteel_cn where (minfo4 is null or length(minfo4)<5 ) and (page_type!=2 ) and length(page)>100;

 

select count(1) cnt from dm.algo_m_gg_1_prt_qycg_ebs_shasteel_cn where (minfo4 is null or length(minfo4)<5 ) and (page_type!=2 or page_type is null) and length(page)>100;

 

 

 

 

 

page_type 有的内容为null,条件page_type!=2,对这种值没有约束

 

以上是关于postgresql  null 值 不受查询条件约束的主要内容,如果未能解决你的问题,请参考以下文章

PostgreSQL:创建索引以快速区分 NULL 和非 NULL 值

在 PostgreSQL 中使用 COALESCE 处理 NULL 值

如何使用 Python 将“NULL”值插入 PostgreSQL 数据库?

MyBatisPlus之条件查询(常规查询范围查询模糊查询null值处理等)

PostgreSQL Json字段作为查询条件案例

PostgreSQL JOIN没有匹配的NULL值