sql server 2012使用新特性offset和fetch next完成分页操作

1

select *
     from HumanResources.Department
     where DepartmentID>1
order by DepartmentID
offset 2 rows
fetch next 5 rows only;

offset后面的数字表示指定在何处开始返回行,fetch 则表示返回多少行

原文地址:https://www.cnblogs.com/mibing/p/7521889.html