判空查询 查出列为null的 与列不为null的

99 阅读1分钟

原始数据

查询不为空的

select * from testone where age is not null;

查询为空的

select * from testone where age is null;

找出年龄字段为null的 并给与它默认值

update testone set age = 18 where age is null;