关于如下语句的调优!
select * from
(
select
rownum rn , t.* from
(
select handle_date, agent_code,agent_name,dept,business_type, count(distinct account_name),count(distinct business_code)
from cust a where mymonth = '200504'
and not exists
(
select 1 from cust b where mymonth='200503' and a.business_code = b.business_code
)
group by handle_date, agent_code,agent_name,dept,business_type
) t
where rownum < 15137
) where rn > 15117
由于cust那张表数据比较多,所以每执行一次这条语句。需要花费一分半多分钟。请问,有什么好的办法调优呢。多谢了