`
well_lf
  • 浏览: 173122 次
  • 性别: Icon_minigender_2
  • 来自: 深圳
社区版块
存档分类
最新评论

oracle分页查询sql

 
阅读更多

查询第11~20条数据:

1、无order by排序的写法:

select * from 
   (select rownum as rowno,t.* from  test t where rownum <= 20)tt
 where tt.rowno > 10;

 

2、有order by排序的写法:

select * from 
   (select tt.*, rownum as rowno from
        (select t.* from  test t order by t.time desc) tt
    where rownum <= 20)
 where rowno > 10

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics