zoukankan      html  css  js  c++  java
  • Oracle百万数据查询语句

    SELECT *
      FROM (SELECT e.*, ROWNUM rn
              FROM (SELECT id,
                           name,
                           age,
                           birthDate,
                           sex,
                           describe,
                           city,
                           create_by,
                           create_date,
                           update_by,
                           update_date,
                           del_flag
                      FROM t_employee
                     where del_flag = 0
                     order by create_date desc) e
             WHERE ROWNUM <= 1000000)
     WHERE rn > 999980;
    select id,
           name,
           age,
           birthDate,
           sex,
           describe,
           city,
           create_by,
           create_date,
           update_by,
           update_date,
           del_flag
      from t_employee t1,
           (select rid
              from (select rownum rn, t.rid
                      from (select
                             rowid rid
                              from t_employee
                            where del_flag = 0
                            order by create_date desc) t
                     where rownum <= 1000000)
             where rn > 999980) t2
     where t1.rowid = t2.rid;
    select *
      from (select *
              from (select id,
                           name,
                           age,
                           birthDate,
                           sex,
                           describe,
                           city,
                           create_by,
                           create_date,
                           update_by,
                           update_date,
                           del_flag,
                           row_number() OVER(ORDER BY create_date desc) AS rn
                      from t_employee) p
             where p.rn > 999980) q
     where rownum < = 20

     http://blog.csdn.net/wacthamu/article/details/8562823

    追梦的脚步,永不停息
  • 相关阅读:
    git使用
    javascript关于事件与闭包
    Ajax和跨域
    通过触发器进行的操作
    30分钟学会jquery插件
    那些年用过的jquery插件
    网页设计常用网页技巧
    XML操作
    效果A:浏览器跳转以及判断来路客户信息
    数据库
  • 原文地址:https://www.cnblogs.com/liuzhenping/p/7479079.html
Copyright © 2011-2022 走看看