码迷,mamicode.com
首页 > 其他好文 > 详细

空值处理

时间:2015-06-21 00:40:29      阅读:205      评论:0      收藏:0      [点我收藏+]

标签:

l数据库中,一个列如果没有指定值,那么值就为null,这个null和C#中的null,数据库中的null表示“不知道”,而不是表示没有。因此select null+1结果是null,因为“不知道”加1的结果还是“不知道”。
lselect * from score where english = null ;
lselect * from score where english != null ;都没有任何返回结果,因为数据库也“不知道”。
lSQL中使用is null、is not null来进行空值判断: select * from score where english is null ; select * from score where english is not null ;
lISNULL ( check_expression , replacement_value )

空值处理

标签:

原文地址:http://www.cnblogs.com/hsha/p/4591262.html

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