SELECT …。
FROM EMP A,DEPT B WHERE A.DEPT_NO = B.DEPT(+)
AND B.DEPT_NO IS NULL AND B.DEPT_CAT(+) = ‘A’(方法二: 最高效)
SELECT …。
FROM EMP E WHERE NOT EXISTS (SELECT ‘X’FROM DEPT D WHERE D.DEPT_NO = E.DEPT_NO AND DEPT_CAT = ‘A’);当然,最高效率的方法是有表关联。直接两表关系对联的速度是最快的!
重点关注11:识别‘低效执行’的SQL语句。 重点关注用下列SQL工具找出低效SQL:SELECT EXECUTIONS , DISK_READS, BUFFER_GETS,ROUND((BUFFER_GETS-DISK_READS)/BUFFER_GETS,2) Hit_radio,ROUND(DISK_READS/EXECUTIONS,2) Reads_per_run,SQL_TEXT FROM V$SQLAREA WHERE EXECUTIONS>;0 AND BUFFER_GETS >; 0 AND (BUFFER_GETS-DISK_READS)/BUFFER_GETS < 0.8 ORDER BY 4 DESC;