Mysql中NULL和空白值之间的区别 [英] Difference between NULL and Blank Value in Mysql

查看:154
本文介绍了Mysql中NULL和空白值之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须检查名为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; "

推荐答案

  1. NULL是一个没有值的值.空字符串是一个值,但只是空的. NULL对数据库来说是特殊的.

  1. NULL is an absence of a value. An empty string is a value, but is just empty. NULL is special to a database.

NULL没有边界,可以用于数据库中的stringintegerdate等字段.

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和空白值之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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