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;

  • 相关阅读:
    下雪诗
    华视身份证阅读器100UC HTTP模式二次开发
    C# Action 和 Func 区别
    网站部署——文件系统
    前端-JavaScript DOM和BOM
    IO多路复用
    python-协程
    python-线程
    python-进程
    计算机与操作系统简介
  • 原文地址:https://www.cnblogs.com/Mike_Chang/p/9311732.html
Copyright © 2011-2022 走看看