首页 > 代码库 > oracle分页

oracle分页

-------oracle---------

create table users(
    u_id number(8),
    u_name varchar2(8),
    u_sal number(6,2)
);

 

方案一:

select u_name,u_sal
from (select users.*,rownum rn from users where rownum <= end)
where rn > start

 

方案二:

 select u_name,u_sal
 from (select users.*,rownum rn from users)
 where rn between start and end

 

方案一效率更高!!!

oracle分页