oracle分页查询疑问。

来源:4-3 不同数据库的分页实现原理

慕斯2296656

2019-11-17 13:54:29

oracle的分页查询为什么要写成三个select字句?
下面的这种写法有没有什么问题?
select t.* from (
        select rownum as row_num ,table.* from table order by id asc
 ) t where t.row_num>10 and t.row_num<=20;


写回答

1回答

慕设计6382757

2019-11-17

主要是采用虚拟的rownum会导致查询出来的顺序不对,你可以看看这个

https://www.cnblogs.com/binblog/archive/2012/01/02/2309991.html 

你这么写应该没问题

如果帮助到你,请采纳,谢谢

0

0 学习 · 8016 问题

查看课程

相似问题