随笔 - 42  文章 - 5  评论 - 47 

@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

posted on 2007-03-29 15:14 gjung 阅读(150) 评论(0) 编辑 收藏