oracle中 a!=null 返回的结果永为UNKNOWN
A condition that evaluates to UNKNOWN acts almost like FALSE(可以把UNKNOWN当做false来对待)
在oracle中where col not in() 中不能使用null值
1 | SELECT * FROM table1 t1 WHERE t1.col1 not in ( 20 , NULL ); |
等价于1
SELECT * FROM table1 t1 WHERE t1.col1 != 20 AND t1.col1 != NULL;
- t1.col1 != NULL这个结果永远为UNKNOWN 返回的结果集也就是空,但是 in ()可以使用null,没有影响
详情查看官方文档 (ps:在最后面)