Oracle 中的三种分页方式

xiaoxiao2021-02-28  15

第一种

select b.* from (

(

select a.* from (

    (select emps.* rownum nu from emps) a

) where nu <=5

)  b where nu >0 ;

这种方式的查询效率最高, 因为他在第二次子查询就进行了分页的控制, 限制了最高的查询条数

第二种

select a.* from (

    (select emps.* rownum nu from emp where nu<5) a

) from nu >0 ;

我感觉这种效率也是很高的

第三种

select a.* from (

(select emp.* rownum nu from emps ) a

) where nu between 0 and 4

转载请注明原文地址: https://www.6miu.com/read-2602552.html

最新回复(0)