The ANY command returns true if any of the values in the subquery meet the condition.
The subsequent SQL statement returns TRUE and lists the product names if it finds any records in the OrderDetails table where the quantity is equal to 10.
SELECT ProductName FROM Products WHERE ProductID = ANY (SELECT ProductID FROM OrderDetails WHERE Quantity = 10); |
The provided SQL statement returns TRUE and lists the product names if it finds any records in the OrderDetails table where the quantity exceeds 99.
SELECT ProductName FROM Products WHERE ProductID = ANY (SELECT ProductID FROM OrderDetails WHERE Quantity > 99); |