1.不为空
select * from table where id <> "";
select * from table where id != "";
select * from table where is not null;
2.为空
select * from table where id ="";
select * from table where isNull(id);
select * from table where id is null;
博客主要介绍了数据库查询时判断字段为空和不为空的SQL语句。不为空的查询语句如 `select * from table where id <> \\;` 等;为空的查询语句如 `select * from table where id =\\;` 等。
1.不为空
select * from table where id <> "";
select * from table where id != "";
select * from table where is not null;
2.为空
select * from table where id ="";
select * from table where isNull(id);
select * from table where id is null;
转载于:https://www.cnblogs.com/sqldata/p/10909868.html

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