当前位置: 移动技术网 > IT编程>数据库>MSSQL > SQL语句查询是否为空 =null及null

SQL语句查询是否为空 =null及null

2017年12月12日  | 移动技术网IT编程  | 我要评论

郑安琦,太上唤魔录,非凡网

a                  b                             c             d

980515      精頂企業有限公司         簡家豪      null

980514      全欣木業有限公司         null       123

980514      迅億科技股份有限公司   簡逢浚      null

980515      聖越國際企業有限公司   null       111 

表结构如上所示,要查询c列为空的记录的sql语句不是select * from table where c=null; 或者 select * from table where c=''; 而应当是 select * from table where c is null; 相反地要查询不为空的则应当是 select * from talbe where c<>''; 或者 select * from table where c is not null; 注意:不是not is null哦。

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网