在in中包含null时,同正常的in,当然null in (null)除外,如下:
SQL> select 'a' from dual where 1 in(1,2,'');
'A'
---
a
SQL> select 'a' from dual where null in(1,2,'');
'A'
---
SQL> select 'a' from dual where null in(null);
'A'
---
在not in中包含null时,条件相当于永远不成立(或者unknown),如下:
SQL> select 'a' from dual where 1 not in(1, null);
'A'
---
SQL> select 'a' from dual where 1 not in(3, null);
'A'
---
SQL> select 'a' from dual where null not in(null);
'A'
---
SQL> select 'a' from dual where null not in(null,4);
'A'
---
阅读(1137) | 评论(0) | 转发(0) |