http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:25685777038588[@more@]
in general your query won't get the "next n rows".
Why would you not just:
select /*+ FIRST_ROWS */ *
from ( select /*+ FIRST_ROWS */ a.*, rownum rnum
from (select /*+ FIRST_ROWS */ * from t where .... order by ... ) a
where rownum <= :MAX_ROW )
where rnum >= :MIN_ROW;
done. that is how I write all pagination queries.
(you do know that A||B has serious programming issues -- A=1, B=11 vs A=11, B=1
-- you need to encode the fields very very carefully. don't go there, really
bad, confusing idea.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/94317/viewspace-796992/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/94317/viewspace-796992/