Oracle 分页算法两则
- -- Oracle 分页算法一
- select * from (
- select page.*,rownum rn from (select * from help) page
- -- 20 = (currentPage-1) * pageSize + pageSize
- where rownum <= 20
- )
- -- 10 = (currentPage-1) * pageSize
- where rn > 10;
- -- Oralce 分页算法二
- -- 20 = (currentPage-1) * pageSize + pageSize
- select * from help where rownum<=20
- minus
- -- 10 = (currentPage-1) * pageSize
- select * from help where rownum<=10;