MySQL WHERE

Last Updated: March 10, 2022

WHERE clause is used to filter data from records set

You can specify the selection criteria with the WHERE clause

WHERE Syntax

SELECT column1, column2, ...
FROM table_name
WHERE condition;

Get the employees whose age is greater than 40

SELECT name FROM employees WHERE age > 40

Conditions used in the WHERE clause

= Equal
> Greater than
>= Greater than or equal
< Less than
<= Less than or equal
<> Not equal to
Test