3

What would be the syntax in SQL Server 2012 for the following MySQL Sql query:

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

Ref: Use LIMIT to paginate results in MySQL query

I want change the database to SQL Server.

TIA

Community
  • 1
  • 1
Murali Bala
  • 1,133
  • 2
  • 18
  • 28

1 Answers1

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;
M.Ali
  • 67,945
  • 13
  • 101
  • 127