标签:基础 htm des tar div width tween rownum targe
常用关系数据库分页SQL都是不相同的,不过大同小异。 |
下面是Oracle分页简单事例图片以及代码:
select * from table_Name t order by active_count desc;
select * from (select * from table_Name order by active_count desc) where rownum = 1;
select * from (select * from table_Name order by active_count desc) where rownum <= 3;
select * from (select t.*, rownum as no from (select * from table_Name order by active_count desc) t) where no between 2 and 3
select * from (select t.*, rownum as no from (select * from table_Name order by active_count desc) t where rownum <= 3 ) where no between 2 and 3
select * from (select t.*, rownum as no from (select * from table_Name order by active_count desc) t) where no >=2
解释:
rownum 是在已产生数据的基础上伪生成的编号,所以 使用rownum 必须在已有数据的基础上,因此Oracle分页才加入了多个子查询。
本文地址:https://www.linuxprobe.com/oracle-data-paging.html
标签:基础 htm des tar div width tween rownum targe
原文地址:https://www.cnblogs.com/cainiaoyige1/p/14651494.html