Caché SQL Reference
Matches a value with at least one matching value from a subquery.
scalar-expression comparison-operator SOME (subquery)
||A scalar expression (most commonly a data column) whose values are being compared with the result set generated by subquery.
||One of the following comparison operators: = (equal to), <> or != (not equal to), < (less than), <= (less than or equal to), > (greater than), >= (greater than or equal to), [ (contains), or ] (follows).
||A subquery, enclosed in parentheses, which returns a result set that is used for the comparison with scalar-expression.
keyword works in conjunction with a comparison operator to create a predicate
(a quantified comparison condition) that is true if the value of a scalar expression matches one or more of the corresponding values retrieved by the subquery
. The SOME
predicate compares a single scalar-expression
item with a single subquery SELECT
item. A subquery with more than one select item generates an SQLCODE -10 error.
keywords are synonyms.
The following example selects those employees with salaries greater than $75,000 that live in any of the states west of the Mississippi River:
SELECT Name,Salary,Home_State FROM Sample.Employee
WHERE Salary > 75000
AND Home_State = SOME
(SELECT State FROM Sample.USZipCode
WHERE Longitude < -93)
ORDER BY Home_State