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;