SQL QUALSIASI parola chiave
❮ Riferimento alle parole chiave SQL
QUALUNQUE
Il ANY
comando restituisce true se uno qualsiasi dei valori della sottoquery soddisfa la condizione.
La seguente istruzione SQL restituisce TRUE ed elenca i nomi dei prodotti se trova QUALSIASI record nella tabella OrderDetails dove quantità = 10:
Esempio
SELECT ProductName
FROM Products
WHERE ProductID = ANY (SELECT
ProductID FROM OrderDetails WHERE Quantity = 10);
La seguente istruzione SQL restituisce TRUE ed elenca i nomi dei prodotti se trova QUALSIASI record nella tabella OrderDetails in cui quantità > 99:
Esempio
SELECT ProductName
FROM Products
WHERE ProductID = ANY (SELECT ProductID
FROM OrderDetails WHERE Quantity > 99);
❮ Riferimento alle parole chiave SQL