实现方法:
- where col_name is not null
- where col_name != ‘null’
- where col_name <> ‘null’
exp:

代码实现:
--方法一 注意null加引号
select device_id , gender , age , university
from user_profile
where age != 'null'
--方法二 注意null加引号
select device_id , gender , age , university
from user_profile
where age <> 'null'
--方法三
select device_id , gender , age , university
from user_profile
where age is not null
本文介绍了三种在SQL中查询非空字段的有效方法,并通过具体示例展示了如何使用这些方法来过滤掉NULL值,适用于年龄等字段的数据清洗场景。
892

被折叠的 条评论
为什么被折叠?



