FETCHas in the example below; the other reserved words are optional.
FETCHclause should be after the main part of the query possibly including an
ORDER BYclause but before an
OPTIONclause including hints, see example below.
OFFSETclause can be used to skip a number of rows before beginning to fetch the rows. This can be used to apply patterns like result pagination.
OFFSET 0is the same as omitting the
OFFSETfunctionality typically used in RESTful web applications has a set of issues when the database is updated while data is being fetched. When using the standard
OFFSETand data is updated, deleted or inserted between requests, the client will receive the same row twice (if a row already retrieved was inserted) or miss a row (if a row already retrieved was deleted).
OFFSEThas performance limitations, since it is difficult to know which objects should be retrieved from each table to skip the requested number of rows in the result.