有人可以在oracle db中解释下面查询的功能,为什么不返回最后一个空行.还请在空值的情况下解释我的功能.
Table Store_Information
store_name Sales Date
Los Angeles $1500 Jan-05-1999
San Diego $250 Jan-07-1999
San Francisco $300 Jan-08-1999
Boston $700 Jan-08-1999
(null) $600 Jan-10-1999
SELECT *
FROM scott.Store_Information
WHERE store_name IN (null)
STORE_NAME SALES DATE
-------------------- -------------------- -------------------------
0 rows selected
Run Code Online (Sandbox Code Playgroud)
SELECT *
FROM scott.Store_Information
WHERE store_name IS null;
Run Code Online (Sandbox Code Playgroud)
NULL不能与其他(实际)值"比较".因此你必须使用IS NULL或IS NOT NULL.
以下是关于此主题的一系列博客文章:http://momjian.us/main/blogs/pgblog/2012.html#December_26_2012