Offset



OFFSET skips the given number of rows. It is the last clause of a SELECT, after ORDER BY. Combine it with Top to read one page of results at a time.

round-pushpin Returns rows 4 through 6 (the second page of three rows).
SELECT TOP 3
    Id, Text
FROM
    WordList:Word
ORDER BY
    Id
OFFSET 3

round-pushpin Returns every row after the first 12.
SELECT Id, Text FROM WordList:Word ORDER BY Id OFFSET 12

Ordering

Always use ORDER BY with OFFSET. Without it the order of the rows is not defined, so pages can overlap or skip rows.




SQL :: Distinct
Removes duplicate rows from the results of a SELECT.
SQL :: Keywords
A breakdown of all of the statements and keywords supported by the query processor.
SQL :: Order By
Order by sorts a result set by a given set of fields or expressions.
SQL :: Select
Select statements are used to read (or query) data from the database.
SQL :: Top
The TOP keyword limits the number of results that are returned by a query.