--效率低

select * from (select rownum rn, d.* from table d )p where p.rn<=20 and p.rn>=10;

select * from (select rownum rn, d.* from table d  )p where p.rn between 10 and 20;

--效率高 

select * from (select rownum rn, d.* from table d where rownum<=20 )p where p.rn>=10;

  

select * from (select rownum rn, d.* from table d where rownum<=20 )p where p.rn>=10;
为什么不直接用 select rownum rn, d.* from table d where rownum between 10 and 20 select * from (select rownum rn, t.* from ( select d.* from table d order by 1 desc )t where rownum<=20 )p where p.rn>=10;

  

Oracel 中的分页的更多相关文章

  1. tp中使用分页技术

    1 public function showList() { $m_ld = D ( 'guangxi_ld' ); $page = I ( 'get.p', 1 ); // 在配置中获取分页值 $p ...

  2. Oracle中经典分页代码!

    在Oracle中因为没有top关键字,所以在sqlserver中的分页代码并不适用于Oracle,那么在Oracle中如何来实现分页呢? --查询所有数据 STUNO STUNAME STUAGE S ...

  3. 在yii中使用分页

    yii中使用分页很方便,如下两种方法: 在控制器中: 1. $criteria = new CDbCriteria(); //new cdbcriteria数据库$criteria->id = ...

  4. [数据库]Oracle和mysql中的分页总结

    Mysql中的分页 物理分页 •在sql查询时,从数据库只检索分页需要的数据 •通常不同的数据库有着不同的物理分页语句 •mysql物理分页,采用limit关键字 •例如:检索11-20条 selec ...

  5. LigerUi中的Grid中不分页显示(local)!

    LigerUi中的Grid中不分页显示! grid为local usePager: true,                         //是否分页

  6. mongo中的分页查询

    /** * @param $uid * @param $app_id * @param $start_time * @param $end_time * @param $start_page * @p ...

  7. springboot中使用分页,文件上传,jquery的具体步骤(持续更新)

    分页: pom.xml     加依赖 <dependency> <groupId>com.github.pagehelper</groupId> <arti ...

  8. restful中的分页

    普通分页 普通分页类似于Django中的分页 源码 class PageNumberPagination(BasePagination): """ A simple pa ...

  9. jdbcTemplate 后台接口中的分页

    Springboot+jdbcTemplate  对查询结果列表做分页, 之前开发的小项目,数据逐渐增多,每次返回所有的查询结果,耗费性能和时间 想到做分页. 于是从简单的分页做起. jdbcTemp ...

随机推荐

  1. getopt_long_only

    st_i2c_parser.c中用到,遂学习一下: 参考:https://blog.csdn.net/pengrui18/article/details/8078813 https://blog.cs ...

  2. Caused by: java.net.BindException: Address already in use: bind

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'brandService ...

  3. MySQL5.7 忘记root密码,怎么破?

    MySQL5.7 忘记root密码,怎么破? 关服 # kill $mysql_pid 免密启动 # /usr/local/mysql57/bin/mysqld_safe --defaults-fil ...

  4. centos install go

    https://golang.org/doc/install 一键安装 https://jamesnbr.wordpress.com/2017/10/18/golang-1-9-1-install-o ...

  5. Bitbucket备份恢复

    我们需要备份什么? home directory:contains  repository data, log files, plugins, and so on. database:contains ...

  6. [c/c++] programming之路(10)、格式符后续

    一.格式符 1. f格式符 #include<stdio.h> #include<stdlib.h> void main(){ printf("%f",10 ...

  7. 盒子总结,文本属性操作,reset操作,高级选择器,高级选择器优先级,边界圆角(了解),a标签的四大伪类,背景图片操作,背景图片之精灵图

    盒子总结 ''' block: 设置宽高 1.没有设置宽,宽自适应父级的宽(子级的border+padding+width=父级的width) 2.没有设置高,高由内容撑开 设置了宽高 一定采用设置的 ...

  8. java利用poi解析excel文件

    首先需要引入以下jar包 如果使用maven,需要添加两个依赖 <dependencies> <dependency> <groupId>org.apache.po ...

  9. ODAC(V9.5.15) 学习笔记(六)TOraSQL、TOraTable和TOraStoredProc

    TOraSQL是一个SQL语句执行控件,包括PL/SQL块等,不返回数据集结果. 名称 类型 说明 ChangeCursor Boolean 在非阻塞模式下是否允许改变屏幕的光标 WaitExecut ...

  10. Python3 tkinter基础 Entry get 点击按钮 将输入框中文字输出到控制台

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...