支持百万数据的分页算法(for sql2005)
说白了是用了sql2005的新函数,用这个函数的新功能再实现存储过程分页就简单多了,而且效率比较高效
Select * From
(
Select ROW_NUMBER() OVER (order by sort_id ) as RowNum,* From TableA
) as TempTable
Where RowNum Between 10 And 20
说白了是用了sql2005的新函数,用这个函数的新功能再实现存储过程分页就简单多了,而且效率比较高效
Select * From
(
Select ROW_NUMBER() OVER (order by sort_id ) as RowNum,* From TableA
) as TempTable
Where RowNum Between 10 And 20