摘要:1、Where子句中的连接顺序: ORACLE采用自下而上的顺序解析WHERE子句。 根据这个原理,表之间的连接必须写在其他WHERE条件之前, 那些可以过滤掉最大数量记录的条件必须写在WHERE子句的末尾。 举例: (低效)select … from table1 t1 where t1.sal > 300 and t1.jobtype = '0001' and 20 < (select count(*) from table1 t2 where t2.pno = t1.tno;(高效)select … from table1 t1 where 20 < (
阅读全文
posted @ 2012-04-16 15:48