首页 > 代码库 > Oracle_rowid_rownum分页
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分页
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。