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