Compares with all values in a query.
Synopsis
scalar-expression comparison-operator ALL query
Arguments
scalar-expression A scalar expression against which values are being compared.
comparison-operator A valid comparison operator, where possibilities are < (less than), <= (less than or equal to), > (greater than), >= (greater than or equal to), <> (not equal to), and = (equal to).
query The data retrieved by a query being used for the comparison.
Description
The ALL operator works in conjunction with a comparison operator to create a specialized condition expression (a quantified comparison condition) that is true if the value of a scalar expression matches all the rows retrieved in a query.
Example
The following example:
SELECT DISTINCT(Customer.Customer),Customer.Name
       FROM Orders,Customer
       WHERE Orders.Customer=Customer.ID
       AND 1000 >= ALL
       (SELECT OrderTotal FROM Orders WHERE Orders.Customer=Customer.ID)
returns a list of customers who have never ordered anything more than $1000.
See Also
ANY SOME