Skip to content

LIMIT

SELECT * FROM employees
LIMIT 5;
+-----------+--------+----------+
| EmployeeID | Name | Position |
+-----------+--------+----------+
| 1 | John | Analyst |
| 2 | Sarah | Designer |
| 3 | Jane | Developer|
| 4 | Bob | Analyst |
| 5 | Alice | Designer |
+-----------+--------+----------+

The LIMIT keyword in MySQL is used to specify the maximum number of records to return. In this example, the query is selecting all columns from the “employees” table, but only returns the first 5 records.