LIMIT 10..20 in SQL Server

后端 未结 15 2490
礼貌的吻别
礼貌的吻别 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:50

    SELECT TOP 10 *
    FROM TABLE
    WHERE IDCOLUMN NOT IN (SELECT TOP 10 IDCOLUMN FROM TABLE)
    

    Should give records 11-20. Probably not too efficient if incrementing to get further pages, and not sure how it might be affected by ordering. Might have to specify this in both WHERE statements.

提交回复
热议问题