bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

SQL ANY Keyword

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 AND Keyword

Next

SQL AS Keyword