Articles → SQL SERVER → Offset And Fetch Clauses In SQL ServersOffset And Fetch Clauses In SQL ServersIn this article, we will discuss offset and fetch clauses in SQL servers.Purpose The Offset and Fetch clauses are used for implementing the server-side paging. The Offset specifies the number of rows to skip.The Fetch clause specifies the number of rows to return after the offset.Example In this example, we will have the sample table with 10 records.Our requirement is to skip the first 3 records and return the next 3 records. So, the query would be: -Select * from OffSetFetchDemo Order BY Id OFFSET 3 Rows fetch next 3 rows onlyOutput Posted By - Karan Gupta Posted On - Thursday, February 2, 2023 Query/Feedback Your Email Id** Subject* Query/Feedback Characters remaining 250**
Select * from OffSetFetchDemo Order BY Id OFFSET 3 Rows fetch next 3 rows only
Query/Feedback