5、oracle rownum分页

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
posted @ 2022-10-11 11:39  站着说话不腰疼  阅读(157)  评论(0)    收藏  举报