Mysql:
select * from tableName limit 参数1,参数2
Mysql的分页使用Limit,第一条记为0
limit 参数1,参数2
参数1,从第几条开始
参数2,返回多少条数据
Oracle:
第一种:
select * from
(
select * t.*,Rownum rn from(select * from tableName) t
where rn <=参数2
)
where rn >=参数1
第二种:
select * from  
(
select t.*, Rownum rn
from (select * from tableName) t
) where rn between 参数1 and 参数2
Oracle第一条记录为1
参数1,从第几条开始
参数2,到第几条记录结束
由内外层查询资源消耗对比,第一种方法,比第二种方法效率更高。
网上找的资料,验证一遍,Mark!

posted on 2012-01-13 10:44  lzycc  阅读(145)  评论(0编辑  收藏  举报