select a.empno from emp a where a.empno not in (select empno from emp1 where job=’SALE’);
---- 倘若利用外部联接,改写命令如下:
select a.empno from emp a ,emp1 b where a.empno=b.empno(+) and b.empno is null and b.job=’SALE’;
---- 可以发现,运行速度明显提高.
---- 倘若利用外部联接,改写命令如下:
select a.empno from emp a ,emp1 b where a.empno=b.empno(+) and b.empno is null and b.job=’SALE’;
---- 可以发现,运行速度明显提高.
select a.key from table1 a
left join table2 b
on a.key=b.key
where b.key is null