ANY
The ANY function returns TRUE if the truth value of at least one value in the set is TRUE.
- boolean-expression
- An expression that returns a value of any built-in Boolean, character-string, graphic-string, binary integer, or decimal floating-point data type. If the argument is not Boolean, it is cast to Boolean before evaluating the function.
The data type of the result is Boolean. The result can be null.
The function is applied to the set of values derived from the argument values by the elimination of null values.
- If the set of values is empty, the result is the null value.
- If the truth value of any value is TRUE, the result is TRUE.
- Otherwise, the result is FALSE.
The specification of DISTINCT has no effect on the result and is not advised.
Example
- For a table containing orders with a Boolean column named PROBLEM, check whether any problems
remain unresolved for orders over 2 weeks
old.
Returns TRUE if the PROBLEM column in any row has a value of TRUE.SELECT ANY(PROBLEM) AS UNRESOLVED FROM ORDERS WHERE ORDER_DATE < CURRENT DATE - 14 DAYS

