aq-optimized-pagination
Web icon

Advanced Query Optimized Pagination

Stable version 1.0.1 (Compatible with OutSystems 11)
Uploaded
 on 10 January 2020
 by 
5.0
 (2 ratings)
aq-optimized-pagination

Advanced Query Optimized Pagination

Documentation
1.0.1

The OFFSET and FETCH clauses are the options of the ORDER BY clause. They allow you to limit the number of rows to be returned by a query.

The following illustrates the syntax of the OFFSET and FETCH clauses:

ORDER BY column [ASC | DESC]
OFFSET offset_row_count {ROW | ROWS}
FETCH {FIRST| NEXT} fetch_row_count {ROW | ROWS} ONLY

In this syntax:

  • The OFFSET clause specifies the number of rows to skip before starting to return rows from the query. The offset_row_count can be a constant, variable, or parameter that is greater or equal to zero.
  • The FETCH clause specifies the number of rows to return after the OFFSET clause has been processed. The offset_row_count can be a constant, variable, or parameter that is greater or equal to one.
  • The OFFSET clause is mandatory while the FETCH clause is optional. Also, the FIRST and NEXT are synonyms respectively so you can use them interchangeably. Similarly, you can use the FIRST and NEXT interchangeably.


Tutorial: http://www.sqlservertutorial.net/sql-server-basics/sql-server-offset-fetch/