sqlServer数据库与mysql数据库分页查询语句

sqlServer:

--8代表每页显示行数pagesize,4代表第几页,currentpage

select top 8 * from
(
SELECT 
[ProjectID]
,[ProjectName]
FROM [ReportingSystemDB].[dbo].[Projects]
where [ProjectID] not in (select top (4*8) [ProjectID] from [Projects]) 
) as a

===================

mysql:

select * from table limit (start-1)*limit,limit; 其中start是页码,limit是每页显示的条数。

猜你喜欢

转载自www.cnblogs.com/houzp/p/10469439.html