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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-30 17:11:11
Original
1242 people have browsed it

一,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);

Related labels:
Statement of this Website
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
Latest Issues
Laravel doesn't read POST request with FormData
From 1970-01-01 08:00:00
0
0
0
php - How to optimize this sql?
From 1970-01-01 08:00:00
0
0
0
Error location, SQL statement
From 1970-01-01 08:00:00
0
0
0
node.js - gulp.task async issue
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template