Oracle分頁

          Posted on 2009-01-06 00:41 Robert Su 閱讀(174) 評論(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

          主站蜘蛛池模板: 新民市| 宁陕县| 新宁县| 邯郸县| 白银市| 淮滨县| 阿瓦提县| 句容市| 平乐县| 泸州市| 内丘县| 黄骅市| 泉州市| 山东省| 府谷县| 如东县| 汾西县| 澄城县| 旺苍县| 涡阳县| 通榆县| 黔南| 姚安县| 开化县| 临汾市| 昭觉县| 砀山县| 措勤县| 永城市| 新竹市| 江达县| 枣强县| 获嘉县| 双桥区| 台北县| 娄烦县| 土默特左旗| 大方县| 宁陕县| 康马县| 白沙|