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中得到的表中选择大于开始页的数据

最新文章

  1. linux系统安装配置
  2. 推荐10个bootstrap及其他框架的后台管理模板
  3. Java Hour 9
  4. spark 分析sql内容再插入到sql表中
  5. Tarjan+模板
  6. 实现windows和linux互传文件
  7. JS调用PHP 和 PHP调用JS的方法举例
  8. [JavaScript] Array.prototype.reduce in JavaScript by example
  9. java实现文件编码监测(转)
  10. jQuery中的事件监听方式及异同点
  11. MSMQ小Demo
  12. 01背包dp+并查集 Codeforces Round #383 (Div. 2)
  13. Unity 多屏(分屏)显示,Muti_Display
  14. CSS3背景相关样式
  15. 实验:体会Oracle权限/角色赋予的差异
  16. JavaScript基础:DOM操作详解
  17. python小技巧01递归解释内嵌
  18. Bootstrap洼地
  19. 继承and派生
  20. activemq部署

热门文章

  1. unzip 命令使用
  2. oracle 中的Ipad()函数
  3. AngularJS API之equal比较对象
  4. INSTALL_FAILED_INSUFFICIENT_STORAGE(转发)
  5. iOS开发——UI进阶篇(三)自定义不等高cell,如何拿到cell的行高,自动计算cell高度,(有配图,无配图)微博案例
  6. Unity内存申请和释放
  7. web文件操作常见安全漏洞(目录、文件名检测漏洞)
  8. TP5的图片上传
  9. 有关lucene的问题
  10. (原创)android中使用相机的两种方式