使用is null语句获取空值 [英] Getting null values by using is null statement

查看:128
本文介绍了使用is null语句获取空值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我们的表A有列Column1

i知道如果我们想要为Column1取空值,我们

使用查询

选择*从A

其中Column1为空



而不是查询

选择*从A

其中Column1 = NULL



但是如果我想使用条件Column1 = Null并且想要它给出与Column1相同的结果是Null

是否有任何sql配置或参数应设置为

以使我能够使用此查询或没有



我尝试了什么:



我试图放一个关于在sql server中使用is null语句的问题

if we have table A with Column Column1
i know that if we want to take the rows with null value for Column1 we
use the query
Select * From A
Where Column1 Is Null

And not the query
Select * From A
Where Column1 = NULL

but if i want to use the condition Column1= Null and want it to give the same result as Column1 Is Null
Is there any sql configurations Or Parameters that should be set to on
to make me able to use this query or there is none

What I have tried:

I have tried to put a question about using is null statement in sql server

推荐答案

行的列中的空值意味着该单元格没有值。

where column1 = Null - 这个条件意味着有一些值为Null 并且该值=Null不存在,因此没有结果。

其中column1为空 - 在这种情况下,行没有任何值搜索column1,因此它获取结果。
Null value in a column of a row means there is no value present for that cell.
"where column1=Null" - This condition means that there is some value which is "Null" and that value ="Null" is not present and hence no result comes.
"where column1 is Null" - In this condition, rows which does not have any value for column1 are searched and hence it fetches the result.


这篇关于使用is null语句获取空值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆