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

被折叠的 条评论
为什么被折叠?



