8. 使用decode函数来减少处理时间
使用decode函数可以避免重复扫描相同记录或重复连接相同的表.
例如:
select count(*),sum(sal)
from emp
where dept_no = 0020
and ename like ‘smith%’;
select count(*),sum(sal)
from emp
where dept_no = 0030
and ename like ‘smith%’;
8. 使用decode函数来减少处理时间
使用decode函数可以避免重复扫描相同记录或重复连接相同的表.
例如:
select count(*),sum(sal)
from emp
where dept_no = 0020
and ename like ‘smith%’;
select count(*),sum(sal)
from emp
where dept_no = 0030
and ename like ‘smith%’;