ANY, compares the result to ANY values
ALL, compares the result to ALL values.
Product Cost | Product Name |
5 | Apples |
10 | Orange |
20 | Banana |
Query using ALL keyword will return
SELECT [Product Name] FROM Product WHERE [Product Cost] >= ALL
(SELECT MAX ([Product Cost]) FROM Product)
This query will return a value that is greater than the max value.
Below sample explanation is from MSDN which breaks it down nicely.
For example, >ALL (1, 2, 3) means greater than 3. >ANY means greater than at least one value, that is, greater than the minimum. So >ANY (1, 2, 3) means greater than 1.
No comments:
Post a Comment