首页 > 数据库技术 > 详细

oracle通过行范围查询取4至10行并排序

时间:2015-12-09 09:53:41      阅读:278      评论:0      收藏:0      [点我收藏+]

不能直接用rownum,要查询出来以后用别名转换。

以EMP表为范例,取4至10行:

select * from (select rownum id,t.* from emp t) where id between 4 and 10;

有需要排序的,一定要这样处理:

select * from ( 

select rownum rn,t.* from ( 

select a.* from eba02 a order by eba003) t where rownum <= 110) 

where rn >= 110;

oracle通过行范围查询取4至10行并排序

原文:http://www.jb51.net/article/55063.htm

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!