问题描述
我必须检查名为RESULT
的特定列的值是否为空.
I have to check for a value of a particular Column named RESULT
is blank or not.
当我检查if RESULT IS NULL
时,查询失败,但是当我检查RESULT=''
时,查询成功了.
When I check with if RESULT IS NULL
, the query failed, but When I checked RESULT=''
, it worked.
两者之间有什么区别
请解释.
"UPDATE RLS_TP_2012_03 a, RLS_TP_2012_03 b SET a.COMMENT=b.COMMENT where b.TCODE='T1199' and a.GROUPNAME='xyz' and a.HLABNO=b.HLABNO and a.RESULT =''; ";
"UPDATE RLS_TP_2012_03 a, RLS_TP_2012_03 b SET a.COMMENT=b.COMMENT where b.TCODE='T1199' and a.GROUPNAME='xyz' and a.HLABNO=b.HLABNO and a.RESULT is NULL; "
推荐答案
-
NULL
是一个没有值的值.空字符串是一个值,但只是空的.NULL
对数据库来说是特殊的.
NULL
is an absence of a value. An empty string is a value, but is just empty.NULL
is special to a database.
NULL
没有边界,可以用于数据库中的string
,integer
,date
等字段.
NULL
has no bounds, it can be used for string
, integer
, date
, etc. fields in a database.
NULL
没有分配任何内存,具有NULL
值的string
只是一个指向内存中无处的指针.但是,尽管存储在内存中的值为""
.
NULL
isn't allocated any memory, the string
with NULL
value is just a pointer which is pointing to nowhere in memory. however, Empty IS allocated to a memory location, although the value stored in the memory is ""
.
这篇关于Mysql中NULL和空白值之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!