Oracle分頁(yè)

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

          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


          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           

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

          Copyright © Robert Su

          主站蜘蛛池模板: 郓城县| 德钦县| 安西县| 九龙县| 元氏县| 靖江市| 开原市| 沽源县| 历史| 独山县| 固始县| 高唐县| 鞍山市| 凤庆县| 镇赉县| 永胜县| 集安市| 安龙县| 东乌珠穆沁旗| 民县| 泽库县| 潞城市| 星子县| 聂荣县| 屯留县| 尤溪县| 营山县| 西畴县| 班玛县| 迭部县| 沿河| 景谷| 迁安市| 黔西| 青铜峡市| 正安县| 淄博市| 漳州市| 七台河市| 海兴县| 湘阴县|