空值null比较特殊,它不能通过=或者进行查询,只能用is null或者is not null进行查询,例如你的数据中有null值,那么用 字段名=1,字段名1,字段名=null都不能把这条数据检索出来,只有字段名 is null能检索出来.
所以你需要查询的数据有两种,为null的,或者不等于1的,转化为sql就是
select * from 表 where 字段名 is null or 字段名 1
oracle 不等于1怎么查
最新推荐文章于 2023-11-13 10:12:35 发布
空值null比较特殊,它不能通过=或者进行查询,只能用is null或者is not null进行查询,例如你的数据中有null值,那么用 字段名=1,字段名1,字段名=null都不能把这条数据检索出来,只有字段名 is null能检索出来.
所以你需要查询的数据有两种,为null的,或者不等于1的,转化为sql就是
select * from 表 where 字段名 is null or 字段名 1