zoukankan      html  css  js  c++  java
  • oracle 分页

    -- oracle分页:
      select e.*, rownum rn from (select * from emp) e;
      select e.*, rownum rn from (select * from emp) e where rn < 5; -- 这个不对
      select e.*, rownum rn from (select * from emp) e where rownum <= 10;
      select e.*, rownum rn from (select * from emp) e where rownum <= 10 and rownum >=5; -- 这个也没有结果
      select * from (select e.*, rownum rn from (select * from emp) e where rownum <= 10) o where rn >= 5;
    -- 如果要指定查询列,只需要修改最里层的
      select * from (select e.*, rownum rn from (select ename, sal from emp) e where rownum <= 10) o where rn >= 5;
      select o.ename, o.sal from (select e.*, rownum rn from (select ename, sal from emp) e where rownum <= 10) o where rn >= 5;
    -- 排序也只需要修改最里层即可
      select * from (select e.*, rownum rn from (select ename, sal from emp order by sal) e where rownum <= 10) o where rn >= 5;

  • 相关阅读:
    使用freemarker生成word,步骤详解并奉上源代码
    汉诺塔问题
    java interview
    java 反射
    java 匿名内部类
    java 内部类(转)
    MYSQL和ORACLE的一些区别
    Hibernate总结(转)
    Hibernate的使用
    Arduino LM35温度检测
  • 原文地址:https://www.cnblogs.com/Mike_Chang/p/9311732.html
Copyright © 2011-2022 走看看