17,090
社区成员
发帖
与我相关
我的任务
分享
例如:student表中
name age两列名
张三 20岁 李四 21岁 等等人员19·22岁
然后通过update更改张三的age为null
update student set age=null where name-‘张三’
这时候如果直接对age查询
select age from student
sql中是能显示出张三 null
但是如果要查询不是21岁的人员时
select name,age from student where not age=21
就看不到张三是为什么?
为什么有限定条件筛选过程中,null直接被丢掉不参与呢?
oracle数据库中null只能用is null或者is not null来判断,任何操作符和null的作用结果都是false,数据库中尽量少使用或者不适用null,减少不必要的问题