Oracle分页算法
- 格式:doc
- 大小:24.50 KB
- 文档页数:1
1. -- Oracle 分页算法一
2. select * from (
3. select page.*,rownum rn from (select * from help) page
4. -- 20 = (currentPage-1) * pageSize + pageSize
5. where rownum <= 20
6. )
7. -- 10 = (currentPage-1) * pageSize
8. where rn > 10;
9.
10. -- Oralce 分页算法二
11. -- 20 = (currentPage-1) * pageSize + pageSize
12. select * from help where rownum<=20
13. minus
14. -- 10 = (currentPage-1) * pageSize
15. select * from help where rownum<=10;