1. .根据ROWID来分
  2. select * from t_xiaoxi where rowid in(select rid from (select rownum rn,rid from(select rowid rid,cid from
  3.  
  4. t_xiaoxi order by cid desc) where rownum<) where rn>) order by cid desc;
  5. 执行时间0.03
  6. .按分析函数来分
  7. select * from (select t.*,row_number() over(order by cid desc) rk from t_xiaoxi t) where rk< and rk>;
  8. 执行时间1.01
  9. .按ROWNUM来分
  10. select * from(select t.*,rownum rn from(select * from t_xiaoxi order by cid desc) t where rownum<) where
  11.  
  12. rn>;执行时间0.1
  13. 其中t_xiaoxi为表名称,cid为表的关键字段,取按CID降序排序后的第9981-9999条记录,t_xiaoxi表有70000多条记录
  14. 个人感觉1的效率最好,3次之,2最差

ORACLE分页SQL语句的更多相关文章

  1. ORACLE分页SQL语句(转载)

    1.根据ROWID来分select * from t_xiaoxi where rowid in(select rid from (select rownum rn,rid from(select r ...

  2. Oracle分页查询语句的写法(转)

    Oracle分页查询语句的写法(转)   分页查询是我们在使用数据库系统时经常要使用到的,下文对Oracle数据库系统中的分页查询语句作了详细的介绍,供您参考. Oracle分页查询语句使我们最常用的 ...

  3. oracle常用SQL语句(汇总版)

    Oracle数据库常用sql语句 ORACLE 常用的SQL语法和数据对象一.数据控制语句 (DML) 部分 1.INSERT (往数据表里插入记录的语句) INSERT INTO 表名(字段名1, ...

  4. oracle之sql语句优化

    oracle之sql语句优化 sql语句的优化 1.在where子句中使用 is null 或 is not null 时,oracle优化器就不能使用索引了. 2.对于有连接的列,即使最有一个是静态 ...

  5. oracle中sql语句的优化

    oracle中sql语句的优化 一.执行顺序及优化细则 1.表名顺序优化 (1) 基础表放下面,当两表进行关联时数据量少的表的表名放右边表或视图: Student_info   (30000条数据)D ...

  6. oracle 常用sql语句

    oracle 常用sql语句 1.查看表空间的名称及大小 select t.tablespace_name, round(sum(bytes/(1024*1024)),0) ts_sizefrom d ...

  7. Oracle中SQL语句分类

    Oracle中SQL语句分类如下:1.DML语句 insert/delete/update/select/merge/explan plan/lock table2.DDL语句 create/atlt ...

  8. Oracle和SQL语句的优化策略(基础篇)

    转载自: http://blog.csdn.net/houpengfei111/article/details/9245337 http://blog.csdn.net/uniqed/article/ ...

  9. Access、SQLServer、Oracle常见SQL语句应用区别

    Access.SQLServer.Oracle常见SQL语句应用区别 关劲松 PMP 如果要兼容Access.SQL Server.Oracle三个数据库版本:我们在编写SQL语句的过程中,尽量使用一 ...

随机推荐

  1. js对象遍历

    js对象遍历可以使用比较普遍的方法:如下 var ss={aa:"aa",bb:"bb"}; for(var s in ss){ console.info(&q ...

  2. SQL —— 视图

    1. 为什么使用视图 1) 提高数据的安全型,不同权限的用户可以查看数据的不同. 2) 符合用户日常业务逻辑 2. 什么是视图 视图是一种查看数据库中一个或多个表中的数据的方法. 视图是一种虚拟表. ...

  3. Java 中的System.exit

    在java 中退出程序,经常会使用System.exit(1) 或 System.exit(0). 查看System.exit()方法的源码,如下 /** * Terminates the curre ...

  4. HGE游戏引擎之hgeQuad结构体的使用(用于渲染图片)

    HGE基本的渲染图元是hgeQuad (Quad is the basic HGE graphic primitive),其中有一个hgeVertex成员结构,它用来描述图元顶点信息.The hgeV ...

  5. php版redis插件,SSDB数据库,增强型的Redis管理api实例

    php版redis插件,SSDB数据库,增强型的Redis管理api实例 SSDB是一套基于LevelDB存储引擎的非关系型数据库(NOSQL),可用于取代Redis,更适合海量数据的存储.另外,ro ...

  6. DateTimeUtil 工具类,android 和 java 通用

    import java.sql.Date;import java.text.SimpleDateFormat; public class DateTimeUtil { public final cla ...

  7. SELECT INTO和INSERT INTO SELECT

    --自动创建了target_table表,并复制source_table表的数据到target_table select name,age into target_table from source_ ...

  8. Best Time to Buy and Sell Stock

    class Solution { public: int maxProfit(vector<int>& prices) { //eg: 5 6 2 3 1 4: // 记录i之前最 ...

  9. Positional parameter are considered deprecated; use named parameters or JPA-style positional parameters instead.

    这行代码: List<Cat> catList =session.createQuery("from Cat p where p.name.first_name=?") ...

  10. linkbutton datagrid showdialog 行效果

    protected void DataGrid1_ItemDataBound(object sender, DataGridItemEventArgs e) { ListItemType itemTy ...