--分页控制
declare @pageNumber int --页码
set @pageNumber=1
declare @pageSize int --每页条数
set @pageSize=10
查询出 非(页码-1)*条数 的数据
select top (@pageSize) *
from T_AccountLog
where id not in(select top ((@pageNumber-1)*@pageSize) id from T_AccountLog)
order by id desc
between --之间
查询出 返回 全部结果集之间 ((页码-1)*条数 +1) 和 (条数 * 页码0
1条 至 10条
select * from (
select *, ROW_NUMBER() OVER(Order by id desc ) AS rowid from T_AccountLog
) as userTmp
--where rowid > (@pageNumber-1)*@pageSize and rowid <= @pageSize*@pageNumber
where rowid between (@pageNumber-1)*@pageSize+1 and @pageSize*@pageNumber