It was suddenly discovered today that the "not equal to operator" in Oracle ignores null.
For example, query comm is not equal to 300 of the records, I will take it for granted where comm! = 300
It is expected to return a record that contains null that is not equal to 300 (one of the cases where the consciousness considers null to be "not equal to 30").
In fact, it only returns records that are not null and not equal to 300, as shown in the following test.
Using Scott's common data test:
--All dataSelect * fromscott.emp t;--Not equal (not contain null)Select * fromScott.emp TwhereT.comm!= -;--Not equal (Does contain null)Select * fromScott.emp TwhereT.comm!= - orT.comm is NULL; TEST
Returns only records with Comm not being null and not equal to 300.
In fact, it is not just the "no equals" relationship with NULL, but the other operators are similar, except that the "no equals" usage scenario makes it easy to detect this feature.
The reason for this is null, and the following Oracle documents are visible in the case of NULL:
Http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements005.htm
Http://www.cnblogs.com/nick-huang/p/3921605.html