为什么在 SQL 中 NULL 不能与 NULL 匹配?

2022-01-06 00:00:00 sql null mysql oracle sql-server

我是 SQL 概念的新手,在研究 NULL 表达式时,我想知道为什么 NULL 不能与 NULL 匹配,谁能告诉我一个真实世界的例子来简化这个概念?

I'm new to SQL concepts, while studying NULL expression I wonder why NULL can't match with NULL can anyone tell me a real world example to simply this concept?

推荐答案

规则:即使是 NULL 也不能等于 NULL.

Rule : Not even a NULL can be equal to NULL.

非技术方面

如果你问两个女孩,她们几岁?也许你会听到他们拒绝回答你的问题,两个女孩都给你 NULL 作为年龄,这并不意味着两个女孩的年龄相似.所以没有什么可以等于null.

If you ask two girls, how old they are? may be you would hear them to refuse to answer your question, Both girls are giving you NULL as age and this doesn't mean both have similar age. So there is nothing can be equal to null.

相关文章