今天看执行计划,无意中发现过滤的时候使用一个不知道的函数lnnvl,google发现如下链接,记录如下:
http://www.adp-gmbh.ch/ora/sql/lnnvl.html
create table lnnvl_ex (
a number,
b number
);
insert into lnnvl_ex values (null, null);
insert into lnnvl_ex values (null, 1);
insert into lnnvl_ex values ( 2, 2);
insert into lnnvl_ex values ( 3, null);
insert into lnnvl_ex values ( 4, 5);
select * from lnnvl_ex where a=b;
A B
---------- ----------
2 2
select * from lnnvl_ex where lnnvl(a=b);
A B
---------- ----------
1
3
4 5