Oracle 分页查询

方式1:

SELECT ds.*
  FROM (SELECT row_number() over(order by t.ROWID) AS rn ,t.*
          FROM HWM_TM_REC_GRP t
         WHERE 
               t.last_update_date >
               nvl(to_date(null, 'YYYY-MM-DD'),
                   t.last_update_date - 1)) ds
 WHERE ds.rn BETWEEN 201 AND 300;

 

方式2:

  SELECT ds.*
  FROM (SELECT row_number() over(order by t.ROWID) AS rn,  t.*
          FROM HWM_TM_REC_GRP t
         WHERE 
                t.last_update_date >
               nvl(to_date(null, 'YYYY-MM-DD'),
                   t.last_update_date - 1)
        and rownum <= 0 + 100   ) ds
 WHERE ds.rn >= 0 

 

上一篇:揭秘携程内部海量CRN项目解决方案


下一篇:实现RN导航的操作步骤