什么是“= null”和“ IS NULL“ [英] what is "=null" and " IS NULL"

查看:274
本文介绍了什么是“= null”和“ IS NULL“的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

= null和IS NULL有什么区别? c> WHERE 子句中,

code> column = null 永远不会是真的,使用null这种方式是无效的,你需要说列IS NULL 列IS NOT NULL 。这说明 NULL 的特殊性质,它不是一个检查其相等性的值,它是一个未知的值,因此您需要使用



您可以指定<$ c

$ c> NULL
值使用 = 等于。例如: UPDATE TableX SET Column = NULL ...



链接:

< a href =http://en.wikipedia.org/wiki/Null_%28SQL%29 =noreferrer>维基百科NUll(SQL)

w3schools SQL NULL值

SQL教程,请参阅IS NULL运算符部分


What is the difference between "=null" and "IS NULL"? How are they used differently?

解决方案

In a WHERE clause, column=null will never be true, it is not valid to use null this way, you need to say column IS NULL or column IS NOT NULL. This speaks to the special nature of NULL, it is not a value to check for equality of, it is an unknown value, so you need to use the IS or IS NOT syntax.

You may assign something the NULL value using the = equal. For example: UPDATE TableX SET Column=NULL...

links:
Wikipedia NUll (SQL)
w3schools SQL NULL Values
SQL Tutorial, see IS NULL Operator section

这篇关于什么是“= null”和“ IS NULL“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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