The LIMIT clause is used to specify the number of records to return.
The LIMIT clause is useful on large tables with thousands of records. Returning a large number of records can impact performance.
Below is a selection from the "Customers" table in the Northwind sample database:
The following SQL statement selects the first three records from the "Customers" table:
What if we want to select records 4 - 6 (inclusive)?
MySQL provides a way to handle this: by using OFFSET.
The SQL query below says "return only 3 records, start on record 4 (OFFSET 3)":
The following SQL statement selects the first three records from the "Customers" table, where the country is "Germany":