LIMIT 10..20 in SQL Server

后端 未结 15 2291
礼貌的吻别
礼貌的吻别 2020-11-22 11:21

I\'m trying to do something like :

SELECT * FROM table LIMIT 10,20

or

SELECT * FROM table LIMIT 10 OFFSET 10
15条回答
  •  失恋的感觉
    2020-11-22 12:02

    Unfortunately, the ROW_NUMBER() is the best you can do. It's actually more correct, because the results of a limit or top clause don't really have meaning without respect to some specific order. But it's still a pain to do.

    Update: Sql Server 2012 adds a limit -like feature via OFFSET and FETCH keywords. This is the ansi-standard approach, as opposed to LIMIT, which is a non-standard MySql extension.

提交回复
热议问题