Skip to content

OFFSET

SELECT * FROM Orders
LIMIT 5 OFFSET 3;
| OrderId | CustomerId | EmployeeId | OrderDate | ProductId |
|---------|------------|------------|-----------|-----------|
| 4 | 103 | 2 | 2021-09-04| 30 |
| 5 | 105 | 1 | 2021-09-05| 20 |
| 6 | 108 | 3 | 2021-09-06| 10 |
| 7 | 109 | 4 | 2021-09-07| 40 |
| 8 | 112 | 2 | 2021-09-08| 50 |

In this example, OFFSET 3 instructs MySQL to disregard the first 3 rows and LIMIT 5 limits the output to five rows. Therefore the query displays rows 4 to 8 from the Orders table.