当前位置:Gxlcms > 数据库问题 > Oracle百万数据查询语句

Oracle百万数据查询语句

时间:2021-07-01 10:21:17 帮助过:14人阅读

* 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

 

Oracle百万数据查询语句

标签:数据   from   logs   creat   over   city   oracle   nbsp   name   

人气教程排行