@RecordsInPerPage --每页的记录数
@PageNo --当前页号
如下示例,正确替换@RecordsInPerPage和@PageNo就可方便的取得对应页的记录,效率很好
select TOP @RecordsInPerPage from Employee
and EmpID not in
(select TOP @RecordsInPerPage*(@PageNo-1) EmpID
where
DepId='45'
order by EmpID
)
order by EmpID
转载于:https://www.cnblogs.com/gjung/archive/2007/03/29/693221.html