mysql 查询出某个字段的值不为空的语句

来源:互联网 发布:戴尔ubuntu怎么装系统 编辑:程序博客网 时间:2024/05/19 13:30

1.不为空

select * from table where id <> "";

select * from table where id != "";

2.为空

select * from table where id ="";

select * from table where isNull(id);

具体情况具体分析,如果字段是char或者varchar类型的,使用id=""可以的;

如果字段是int类型的,使用isNull会好些。

1 0
原创粉丝点击