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

mysql中判断字段为空

时间:2014-09-05 00:48:50      阅读:202      评论:0      收藏:0      [点我收藏+]

标签:http   ar   div   sp   c   ef   sql   mysql   table   

mysql中判断字段为null或者不为null
 
在mysql中,查询某字段为空时,切记不可用 = null,
而是 is null,不为空则是 is not null
 
select nulcolumn from table;
if nuncolumn is null then 
select 1;
else 
select 2;
end if;

mysql中判断字段为空

标签:http   ar   div   sp   c   ef   sql   mysql   table   

原文地址:http://www.cnblogs.com/davidwang456/p/3957060.html

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