SQL Server 2012等效限制分页

时间:2015-01-06 22:55:58

标签: mysql sql sql-server pagination

SQL Server 2012中针对以下MySQL Sql查询的语法是什么:

select title,description,tags,post_date
  from myvids order by title desc 
   limit 0,20

参考:Use LIMIT to paginate results in MySQL query

我想将数据库更改为SQL Server。

TIA

1 个答案:

答案 0 :(得分:4)

             /********* For SQL Server 2012 & Later *********/

select [title]
      ,[description]
      ,tags
      ,post_date
from myvids 
ORDER BY [title] OFFSET 0 ROWS FETCH NEXT 20 ROWS ONLY;