oracle分页

本文介绍了在 Oracle 数据库中实现 SQL 分页查询的四种方法:使用 MINUS 进行差集运算、ROWNUM 伪列结合子查询、NOT IN 子句以及基于 ID 排序的分页查询。

在oracle 下面想了4总方法


minus差分页

select * from table where rownum<=10 minus select * from table where rownum<=5


rownum伪列

select * from (select rownum tid,t.* from table t where rownum<=10) where tid<=10 and tid>=5


notin相反

select * from table where id not in(select id from table where rownum<=5) and rownum<=5


前题是id排序的select * from table where id>(select max(id) from table where rownum<=5) and rownum<=5

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值