English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
If any subquery value meets the condition, the ANY command will return true.
The following SQL statement returns TRUE if the quantity in the OrderDetails table is equal to 10The record, then list the product name:
SELECT ProductName FROM Products WHERE ProductID = ANY (SELECT ProductID FROM OrderDetails WHERE Quantity = 10);
The following SQL statement returns TRUE and lists the product names where Quantity > 99any records in the OrderDetails table are found, list the product names:
The following SQL statement returns TRUE if it finds any records in the OrderDetails table, then list the product names where quantity >99:
SELECT ProductName FROM Products WHERE ProductID = ANY (SELECT ProductID FROM OrderDetails WHERE Quantity > 99);