Home  >  Article  >  Database  >  Mysql series (13) paging query statements

Mysql series (13) paging query statements

黄舟
黄舟Original
2017-01-22 17:04:37933browse

Mysql Series (Thirteen) Paging Query Statement

MySql

 select tablename.*  from  tablename limit firstIndex,pageSize;
          firstIndex -------->开始索引
          pageSize--------->页大小

Oracle

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;

and above This is the content of the paging query statement in the Mysql series (13). For more related content, please pay attention to the PHP Chinese website (www.php.cn)!

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