摘要:
rownum和top是不一样的,rownum用来分页是先全选出来,然后取多少条,效率是比较低的。举例:在工作中碰见这样的问题select wfcount,cid from (select count(customer_id) wfcount, customer_id cidfrom aaa_reviewwhere wonderful_flag = 1 group by customer_idorder by wfcount desc) where rownum 100运行时间超过27秒而把外层rownum取消:select count(customer_id) wfcount, custom 阅读全文