码迷,mamicode.com
首页 > 数据库 > 详细

mysql查询语句集

时间:2016-09-06 15:32:10      阅读:152      评论:0      收藏:0      [点我收藏+]

标签:

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

 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会好些。        

 

mysql查询语句集

标签:

原文地址:http://www.cnblogs.com/zhuiluoyu/p/5845541.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!