您的位置:首页 > 数据库 > Oracle

使用标准SQL语句实现分页操作(Oracle)

2004-07-07 11:58 856 查看
方法一:
select * from?
?????? (select rownum as my_rownum,a.* from?my_table? where rownum<20000)
where my_rownum>=10000
方法二:
select * from my_tablewhere rownum<=20000 minus (select * from my_table where rownum<10000)
相比较而言,方法一的效率要高的多。
方法一的改进:
去掉my_rownum字段
select c.* from?
?????? (select rownum as my_rownum,a.* from? my_table? a? where rownum<20000) b ,my_table? c
where my_rownum>=15000 and c.id = b.id;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  oracle sql