LIMIT 10..20 in SQL Server

后端 未结 15 2217
礼貌的吻别
礼貌的吻别 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 11:44

    as you found, this is the preferred sql server method:

    SELECT * FROM ( 
      SELECT *, ROW_NUMBER() OVER (ORDER BY name) as row FROM sys.databases 
     ) a WHERE a.row > 5 and a.row <= 10
    

提交回复
热议问题