分页
select * from employees e where rownum between 6 and 10;
rownum,rowid
select * from employees e where rownum between !=1;//查不出结果
select * from employees e where rownum between =1;//查得出结果
select * from employees e where rownum between >1;//查不出结果
分页SQL
select*from
(select e.employee_id,e.first_name from employees e rownum rn from employees e) where rn between 6 and 10;
//涉及到字段要注意
select e.employee_id ,e.first_name,rowunm rn from employees e where rownum<=10
minuse
select e.employee_id ,e.first_name,rowunm rn from employees e where rownum<=5
select t2.employee_id,t2.first_name t2.rn
(select t1.employee_id,t1.first_name rownum rn from
(select e.employee_id,e.first_name from employees e order by
e.employee) t1 where t1.rn <=10
) t2 where t2.rn>=6
网友评论