Oracle分页语句
2024-08-29 10:56:18
select * from (select A.*,rownum rd from (select * from [tablename] where [condition] order by [condition] ) A where rownum<=[endpage*pagesize]) where rd>=[startpage*pagesize];
1.select * from [tablename] where [condition] order by [condition]
按条件对数据表进行筛选排序,作为分页的基本数据
2.select A.*,rownum rd from (select * from [tablename] where [condition] order by [condition] ) A where rownum<=[endpage*pagesize]
使用rownum选择小于结尾页的数据,必须对rownum采用别名
3.select * from (select A.*,rownum rd from (select * from [tablename] where [condition] order by [condition] ) A where rownum<=[endpage*pagesize]) where rd>=[startpage*pagesize]
在2中得到的表中选择大于开始页的数据
最新文章
- linux系统安装配置
- 推荐10个bootstrap及其他框架的后台管理模板
- Java Hour 9
- spark 分析sql内容再插入到sql表中
- Tarjan+模板
- 实现windows和linux互传文件
- JS调用PHP 和 PHP调用JS的方法举例
- [JavaScript] Array.prototype.reduce in JavaScript by example
- java实现文件编码监测(转)
- jQuery中的事件监听方式及异同点
- MSMQ小Demo
- 01背包dp+并查集 Codeforces Round #383 (Div. 2)
- Unity 多屏(分屏)显示,Muti_Display
- CSS3背景相关样式
- 实验:体会Oracle权限/角色赋予的差异
- JavaScript基础:DOM操作详解
- python小技巧01递归解释内嵌
- Bootstrap洼地
- 继承and派生
- activemq部署