Row Offset in SQL Server

后端 未结 16 2412
醉酒成梦
醉酒成梦 2020-11-22 05:53

Is there any way in SQL Server to get the results starting at a given offset? For example, in another type of SQL database, it\'s possible to do:

SELECT * FR         


        
16条回答
  •  太阳男子
    2020-11-22 06:25

    Following will display 25 records excluding first 50 records works in SQL Server 2012.

    SELECT * FROM MyTable ORDER BY ID OFFSET 50 ROWS FETCH NEXT 25 ROWS ONLY;
    

    you can replace ID as your requirement

提交回复
热议问题