当前位置:   article > 正文

Oracle分页2

oracle 分页第二页

常用这种,在内存分页上效率最高的,当然比不上物理分页咯

select * from (select row_.*, rownum rownum_ from (SELECT c.*  FROM   web_content c) row_ where rownum <=4+10 ) where rownum_ > 4

 

 

下面这种拿不出值,为什么呢

select b.*,rownum from web_content b where rownum in (SELECT RN FROM (SELECT ROWNUM RN,c.* FROM web_content c) a WHERE RN <= 5+4 )

 

------------------------------------------------------------------------------------------------------------------------------------------------------------------

select * from (select row_.*, rownum rownum_ from (
SELECT U.*
FROM
WEB_URL_CONFIG U
WHERE U.URL_ID !='0'
ORDER BY U.URL_STYLE,U.IS_VALID DESC

) row_ where rownum <=20 order by URL_STYLE,IS_VALID desc) where rownum_ > 10

有排序时,上面的SQL语句有问题,改成下面的任意两种

曾经理修改版:

select * from (select row_.*, rownum rownum_ from (
select aa.*,rownum
from (SELECT U.*
FROM
WEB_URL_CONFIG U
WHERE U.URL_ID !='0'
ORDER BY U.URL_STYLE,U.IS_VALID DESC
) aa
) row_ where rownum <=20 order by URL_STYLE,IS_VALID desc) where rownum_ > 10

 

黄经理版:
select t2.* from (select t1.*,rownum rnum from (
查询表全部数据
) t1 )t2 where <![CDATA[t2.rnum > #criteria.index#]]>
and <![CDATA[t2.rnum < (#criteria.rows#+#criteria.index#+1)]]>




转载于:https://www.cnblogs.com/xhqgogogo/p/3257481.html

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/268630
推荐阅读
相关标签
  

闽ICP备14008679号