Oracle分页大家一般使用这种形式
SELECT * FROM
(
SELECT A* rownum r
FROM
(
SELECT *
FROM Articles
ORDER BY PubTime DESC
) A
) B
WHERE r <= PageUpperBound
and r > PageLowerBound;
在很多时候并不需要排序而是要进行多表的联查计算等这个时候数据多了就会显的很慢
发现慢就慢在Order By上
更改如下
SELECT * FROM
(
SELECT A* rownum r
FROM
(
SELECT *
FROM Articles
) A
WHERE rownum <= PageUpperBound ORDER BY PubTime DESC //Order by 放这来
)B
and r > PageLowerBound;