Home >Database >Mysql Tutorial >Oracle中操作分页

Oracle中操作分页

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 16:56:59931browse

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

如果基础查询不需要排序,可以省掉一层嵌套
select * from (
    select t.*,rownum from table1 t where condition )
    where rownum>(pangeNow-1)*5 and rownum 
mysql中分页的写法:
select t.* from tbl_user t order by t.id limit $offset , $perpage
$currentPage = 1;//当前页码
其中后面$offset指的是第几页开始,,$perpage每页显示的行数,
$offset = $perpage*($currentPage-1)

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn