rownum的使用
1第一个查询中,rownum只能使用<=,<
2每个查询中rownum只能使用一次

–如果想要用rownum不从1开始,需按下面方法使用
select a1.* from (select student.*,rownum rn from student) a1 where rn >5;

--分页查询  
select * from (select a1.*,rownum rn from (select * from student) a1 where rownum <=10) where rn>=6;

--分页查询二

select a1.* from (select student.*,rownum rn from student where rownum <=10 )a1 where rn >=6;

--分页查询三
select a1.* from (select student.*,rownum rn from student) a1 where rn between 6 and 10;

这里写图片描述

posted on 2017-06-11 12:26  2637282556  阅读(80)  评论(0编辑  收藏  举报