MySQL subquery within a WHERE clause
MySQL subquery with comparison operators
If a subquery returns a single value, you can use comparison operators to compare it with the expression in the WHERE clause. For example, the following query returns the customer who has the maximum payment.