O'Reilly logo

MySQL 8 Cookbook by Karthik Appigatla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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)

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required