oracle分页查询

oracle实现分页查询:

第一种方式(查询第11到第20条数据):

select t.* from

  (select t.*,rownum rn from T_TEST  t where rownum<=20) t

  where rn>10

排序查询(查询第11到第20条数据):

select * from

  (select t1.* ,rownum rn from

    (select * from T_TEST t order by t.id desc) t1

          where rownum<=20) 

  where rn>10

 

posted @ 2018-06-13 14:18  第二人生Bonnie  阅读(196)  评论(0编辑  收藏  举报