mysql中分页的写法:select t.* from tbl_user t order by t.id limit $offset , $perpage$currentPage = 1;//当前页码其中后面$
sql:
with partdata as (select rownum rowno,t.* from tablename t where column='1090'order by column) select * from partdata where rowno between 0 and 50
据说这个速度快。
下面这个也可以:
Oracle分页有通用写法,假设一页5行
select * from (
select t.*,rownum from (
select * from table1 where condition order by column) t )
where rownum>(pangeNow-1)*5 and rownum<=(pageNow)*5
如果基础查询不需要排序,可以省掉一层嵌套
select * from (
select t.*,rownum from table1 t where condition )
where rownum>(pangeNow-1)*5 and rownum<=(pageNow)*5
mysql中分页的写法:
select t.* from tbl_user t order by t.id limit $offset , $perpage
$currentPage = 1;//当前页码
其中后面$offset指的是第几页开始,,$perpage每页显示的行数,
$offset = $perpage*($currentPage-1)
Copyright © 2019- 7swz.com 版权所有 赣ICP备2024042798号-8
违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务