在order by create_time 的时候,假设所有数据的create_time 值相同,那么
使用:select * from ( selelct s.*,rownum rn from t_student s where rownum <= 10 order by s.create_time) a where a.rn >5
和 select * from ( selelct s.*,rownum rn from t_student s where rownum <= 15 order by s.create_time) a where a.rn >10
可能查到相同的数据。
解决办法:
select * from ( selelct s.*,rownum rn from t_student s order by s.create_time) a where a.rn >10 and a.rn <= 15;
select * from ( selelct s.*,rownum rn from t_student s where rownum <= 15 order by s.create_time,s.id) a where a.rn >10
原文:http://www.cnblogs.com/yingsong/p/5179894.html