What is the Equivalent syntax of mysql “ LIMIT ” clause in SQL Server

前端 未结 3 1587
甜味超标
甜味超标 2021-02-08 11:37

What is the Equivalent syntax of MySQL \" LIMIT \" clause in SQL Server . I would like to use it for doing paging of my results. (want to show records5 to 10 )

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-08 11:52

    The closest to it is SELECT TOP X but it is only equivalent to LIMIT X.

    For LIMIT X, Y, there is no direct MS-SQL equivalent (as far as I know). Christian's solution is a good one though.

    MSSQL2005 (onwards) has the ROW_NUMBER syntax which might be useful:
    http://msdn.microsoft.com/en-us/library/ms186734%28SQL.90%29.aspx

提交回复
热议问题