SQL Server
从数据库表中的第M条记录开始取N条记录,利用Top关键字。
SELECT *
FROM ( SELECT Top N *
FROM (SELECT Top (M + N - 1) * FROM 表名称 Order by 主键 desc) t1 ) t2
Order by 主键 asc
更新
【转】
PAGESIZE:每页显示的记录数
CURRENTPAGE:当前页号
数据表的名字是:components
索引主键字是:id
select top PAGESIZE * from components where id not in
(select top (PAGESIZE*(CURRENTPAGE-1))
id from components order by id)order by id
例如:
select top 10 * from components where id not in
(select top 10*10 id from components order by id)
order by id
从101条记录开始选择,只选择前面的10条记录
My sql
使用limit函数:
SELECT * FROM 表名称 LIMIT M,N
从数据库表中的第M条记录开始取N条记录,利用Top关键字。





【转】
PAGESIZE:每页显示的记录数
CURRENTPAGE:当前页号
数据表的名字是:components
索引主键字是:id








My sql
使用limit函数:

