create table student(
u_name varchar2(20),
age INTEGER
);
insert into student values('zs',12);
insert into student values('zs2',13);
insert into student values('zs3',14);
insert into student values('ls',10);
insert into student values('ls2',11);
insert into student values('ls3',12);
分页查询(rownum) rownum只能够使用<, <=;不能使用>, >=,=来做筛选条件 例如select * from student where rownum<5; 当需要查第三条到第五条记录时,可借助子查询 例如select s.* from (select rownum r,student.* from student) s where r>2 and r<6;
排序分页查询 当需要按姓名排序,查第三条到第五条记录时,可借助子查询嵌套 例如select t.* from (select rownum r,s.* from (select * from student order by u_name) s) t where r>2 and r<6;
案例:create table student( u_name varchar2(20), age INTEGER);insert into student values('zs',12);insert into student values('zs2',13);insert into student values('zs3',14);insert into student values('ls',10);insert into student values('ls2',.