Limiting results

Select the names of any 10 employees whose hire_date is before 1986. You can get this by using the LIMIT clause at the end of the statement:

mysql> SELECT first_name, last_name FROM employees WHERE hire_date < '1986-01-01' LIMIT 10;+------------+------------+| first_name | last_name  |+------------+------------+| Bezalel    | Simmel     || Sumant     | Peac       || Eberhardt  | Terkki     || Otmar      | Herbst     || Florian    | Syrotiuk   || Tse        | Herber     || Udi        | Jansch     || Reuven     | Garigliano || Erez       | Ritzmann   || Premal     | Baek       |+------------+------------+10 rows in set (0.00 sec)

Get MySQL 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.