oracle细节

1.oracle中NVL的含义:

如果oracle第一个参数为空那么显示第二个参数的值,如果第一个参数的值不为空,则显示第一个参数本来的值。

2.Oracle中in和exists的区别:

1).select * from A where id in(select id from B);in适合B表比A表数据小的情况

2).select a.* from A a where exists(select 1 from B b where a.id=b.id);exists适合B表比A表数据大的情况

3.Oracle中union和union all 区别:

union会自动压缩多个结果集合中的重复结果,union all将所有的结果全部显示出来,不管是不是重复

原文地址:https://www.cnblogs.com/xlz307/p/5505657.html