SQL Server 2012 新的分页函数 OFFSET & FETCH NEXT

DECLARE @page INT, @size INT;
select @page = 300, @size = 10

SELECT *
FROM gpcomp1.GPCUST
WHERE company like 'a%'
ORDER BY CUSTNO
OFFSET (@page -1) * @size ROWS
FETCH NEXT @size ROWS ONLY;

posted @ 2014-06-27 11:51  princessd8251  阅读(378)  评论(0编辑  收藏  举报