空值处理

孤街浪徒 提交于 2020-01-01 22:47:03
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 )
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!