Oracle分頁

          Posted on 2009-01-06 00:41 Robert Su 閱讀(172) 評論(0)  編輯  收藏
           看到網上說select * from ( select row_.*, rownum rownum_ from (sql) row_ where rownum <= ?) where rownum_ >?
          這種方法是最快的,特做實驗驗證之

          select row_.*, rownum rownum_ from (select * from web_video) row_ where rownum BETWEEN 1 and 100
          0.05675s 0.1181s
          select row_.*, rownum rownum_ from (select * from web_video) row_ where rownum BETWEEN 100 and 1000
          22.269s
          select * from ( select row_.*, rownum rownum_ from (select * from web_video) row_ where rownum <= 100) where rownum_ >0

          0.156s
          select * from ( select row_.*, rownum rownum_ from (select * from web_video) row_ where rownum <= 1000) where rownum_ >100
          0.037s


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           

          posts - 103, comments - 104, trackbacks - 0, articles - 5

          Copyright © Robert Su

          主站蜘蛛池模板: 仁寿县| 松桃| 盐亭县| 灵石县| 图木舒克市| 西充县| 贵定县| 黄浦区| 龙江县| 金湖县| 如皋市| 拜泉县| 广西| 孝感市| 义乌市| 麦盖提县| 菏泽市| 榆树市| 衡阳县| 阿勒泰市| 长顺县| 晋州市| 分宜县| 广元市| 澳门| 汝城县| 巩义市| 沁水县| 龙岩市| 桂东县| 汨罗市| 张家界市| 惠水县| 雅江县| 衡阳市| 临泉县| 常山县| 基隆市| 石阡县| 舞钢市| 阿尔山市|