Home >Database >Mysql Tutorial >sqlserver分页;mysql分页;orcale分页 的sql 查询语句_MySQL

sqlserver分页;mysql分页;orcale分页 的sql 查询语句_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-30 17:11:111230browse

一,sqlserver分页:

 

SELECT   TOP (每页显示的数据条数) *FROM 表名 WHERE   (ID NOT IN (SELECT TOP ((当前页码 -1)*每页显示的数据条数 -1) ID FROM  表名 AS 表名1_1  ORDER BY ID)) ORDER BY ID;

 

二:mysql分页

 

select  * from 表名 where id limit((当前页码 -1)*每页显示的数据条数,当前页码 * 每页显示的数据条数);

 

三:orcale分页

 

SELECT  * FROM  (  SELECT A.*, ROWNUM RN  FROM (SELECT * FROM 表名) A  WHERE  ROWNUM = ((当前页码 -1)*每页显示的数据条数 +1);

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