bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

SQL ANY Keyword

Concept visual

SQL ANY Keyword

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

ANY Keyword

Previous

❮ SQL Keywords

Next

Any

The ANY

command returns true if any of the subquery values meet the condition. The following SQL statement returns TRUE and lists the productnames if it finds ANY records in the OrderDetails table where quantity = 10:

Example

SELECT ProductName

FROM Products

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

The following SQL statement returns TRUE and lists the productnames if it finds ANY records in the OrderDetails table where quantity > 99:

Example

SELECT ProductName

FROM Products

WHERE ProductID = ANY (SELECT ProductID
FROM OrderDetails WHERE Quantity > 99);

Previous

❮ SQL Keywords

Next

Previous

SQL AND Keyword

Next

SQL AS Keyword