码迷,mamicode.com
首页 > 其他好文 > 详细

分页查询

时间:2016-11-05 12:02:12      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:style   ble   tin   name   span   rac   sql   bsp   查询   

  • 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;

分页查询

标签:style   ble   tin   name   span   rac   sql   bsp   查询   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!