简单回顾下 sqlserver 各个版本支持分页的方式。
SQL Server 2005 支持 top not in 写法
SQL Server 2008 支持 Row_Number()写法
SQL Server 2012 支持 OFFSET、FETCH NEXT 写法
2012的最新的写法:
select * from Sys_UserInfo Order by SysNo asc offset 20 rows fetch next 20 rows only;
offset 开始的行或者跳过的行 fetch next 取出排序后的多少行,是不是比之前的写法方便多了。
原文:https://www.cnblogs.com/wwwan/p/13215281.html