MySQL ANY, ALL

Compare with multiple values.

MySQL ANY and ALL Operators

The ANY and ALL operators allow you to perform a comparison between a single column value and a range of other values.

The ANY Operator

Returns TRUE if ANY of the subquery values meet the condition.

The ALL Operator

Returns TRUE if ALL of the subquery values meet the condition.

Example

SELECT ProductName FROM Products WHERE ProductID = ANY (SELECT ProductID FROM OrderDetails WHERE Quantity = 10);