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

Filter based on condition

Find emp_no of employees with first_name as Georgi and last_name as Facello:

mysql> SELECT emp_no FROM employees WHERE first_name='Georgi' AND last_name='Facello';+--------+| emp_no |+--------+|  10001 ||  55649 |+--------+2 rows in set (0.08 sec)

All the filtering conditions are given through the WHERE clause. Except integers and floating points, everything else should be put inside quotes.

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