首页 > 数据库 >oracle rownum分页

oracle rownum分页

时间:2022-10-11 11:44:35浏览次数:42  
标签:分页 stu oracle rownum where 100 select

目录

oracle rownum分页

1、取前100条数据

语法

select * from stu where rownum < &pageSize;

使用

select * from stu where rownum < 100;

2、取50条到100条的数据

语法

select * from  
(select stu.*,rownum as num from stu where rownum <= (&tPage-1)*&pageSize+&pageSize)  where num > (&currentPage-1)*&pageSize 

使用

select * from 
(select stu.*,rownum as num from stu where rownum <= 100)  
where num > 50

标签:分页,stu,oracle,rownum,where,100,select
From: https://www.cnblogs.com/lgxdev/p/16778705.html

相关文章