# What is the difference between LIMIT and OFFSET in SOQL, and what is the maximum value of OFFSET (2,000)?

**Topic:** Soql · **Difficulty:** Easy · **Asked at:** Cognizant, Wipro, Capgemini · **Tags:** soql, pagination, limits

Read it on the site: https://www.forcechallenges.com/interview-questions/what-is-the-difference-between-limit-and-offset-in-soql-and-what-is-the-maximum-value-of-offset-2-000

## Answer

`LIMIT n` caps the number of rows returned. `OFFSET n` skips the first n rows, useful for pagination (`LIMIT 20 OFFSET 40` = page 3).

The maximum OFFSET is **2,000**. For deeper pagination use keyset pagination (`WHERE Id > :lastId ORDER BY Id LIMIT 200`) or `queryMore` / `Database.getQueryLocator`.

```soql
SELECT Id, Name FROM Account ORDER BY Name LIMIT 10 OFFSET 20
```

---
Source: ForceChallenges · last updated 2026-10-21
