Oracle_rowid_rownum分页
Posted 日月的弯刀
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Oracle_rowid_rownum分页相关的知识,希望对你有一定的参考价值。
Oracle_rowid_rownum_分页
--rowid
select * from account where rowid=‘AAASR6AAEAAAAJWAAA‘; |
select * from stu;
select rownum, stu.* from stu;
select rownum, e.* from emp e;
--Top5,查询工资最高的5个人信息
select rownum, t.*
from (
select * from emp order by sal desc
) t
where rownum<=5; |
--row实现分页
select rownum, t.*
from (
select * from emp order by sal desc
) t
where rownum>5 and rownum<=10;--不行,rownum只能<,<=
--下面的方式实现子查询
select rownum, t.*
from (
select * from emp order by sal desc
) t
where rownum<=10; |
--分页查询,查询6到10行记录
select *
from (
select rownum rn, t.*
from (
select * from emp order by sal desc
) t
where rownum<=10
) temp
where temp.rn>5 and temp.rn<=10; |
以上是关于Oracle_rowid_rownum分页的主要内容,如果未能解决你的问题,请参考以下文章
CF1349C Orac and Game of Life题解