1.不为空 select * from table where id <> ""; select * from table where id != ""; select * from table where id not is null 2.为空 select * from table where id =""; select * from table where isNull(id); select * from table where id is null 具体情况具体分析,如果字段是char或者varchar类型的,使用id=""可以的; 如果字段是int类型的,使用isNull会好些。 相关文章: SQL 查询某字段不为空 2022-12-23 Oracle中查询某字段不为空或者为空的SQL语句怎么写 2022-12-23 SQL 查询某字段id为空(不为空) 2022-12-23 mysql查询json字段中的某个值 2022-12-23 SQL 查询字段为值不为空 2022-12-23 thinkphp查询某个字段为空的数据 2022-01-03 mysql当查询某字段结果为空并赋值 2021-12-10