While the Access / JET TOP keyword does not directly provide the OFFSET option, we can use the clever combination of TOP , subquery, and view to get the same result.
Here is an example of getting 10 rows, starting at offset 20 in the Identity table in ORDER BY Name and Identifier ..
SELECT Person.* FROM Person WHERE Person.Id In ( SELECT TOP 10 A.Id FROM [ SELECT TOP 30 Person.Name, Person.Id FROM Person ORDER BY Person.Name, Person.Id ]. AS A ORDER BY A.Name DESC, A.Id DESC ) ORDER BY Person.Name, Person.Id;
Essentially, we request the top 30, cancel the order, request the top 10, and then select the rows from the table that match, sorting in the direct order again. This should be quite efficient, assuming Id is a PRIMARY KEY , and there is an index in the Name . Perhaps, for best performance, you need a specific coverage index Name , Id (and not just Name alone), but I implicitly cover the indexes of PRIMARY KEY .
source share