首页 > 其他 > 详细

分页查询

时间:2016-11-05 12:01:33      阅读:96      评论:0      收藏:0      [点我收藏+]
  • MySql
     select tablename.*  from  tablename limit firstIndex,pageSize;
          firstIndex -------->开始索引
          pageSize--------->页大小
  • Oracle
  1.         select * from (
                           select a.*,ROWNUM rn from tablename a where ROWNUM<=(firstIndex+pageSize)
                          ) where rn>firstIndex;
 

     2.         select * from(select * from(select p.*,ROWNUM rn from tablename )p  where p.rownumber>firstIndex)  where rownum>pageSize;

分页查询

原文:http://www.cnblogs.com/fufuxi869/p/6032479.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!