expression comparison-operator{ANY|SOME}(subquery)

comparison-operator:=|>|<|>=|<=|<>|!=|!<|!>

The keywords ANY and SOME are synonymous.

With the ANY and SOME search conditions, if the subquery result set is the empty set, the search condition evaluates to FALSE.
Otherwise, the search condition evaluates to TRUE, FALSE, or UNKNOWN, depending on the value of *expression*, and the result set returned by the subquery, as follows:

If the expression value is.. | and the result set returned by the subquery contains at least one NULL, then.. | or the result set returned by the subquery contains no NULLs, then.. |
---|---|---|

NULL | UNKNOWN | UNKNOWN |

not NULL | If there exists at least one value in the subquery result set for which the comparison with the expression value is TRUE, then the search condition evaluates to TRUE. Otherwise, the search condition evaluates to UNKNOWN. | If there exists at least one value in the subquery result set for which the comparison with the expression value is TRUE, then the search condition evaluates to TRUE. Otherwise, the search condition evaluates to FALSE. |

An ANY or SOME search condition with an equality operator, evaluates to TRUE if *expression* is equal to any of the values in the result of the subquery, and FALSE if the value of the expression is not NULL, does not
equal any of the values in the result of the subquery, and the result set doesn't contain NULLs.

The usage of **= ANY** or **= SOME** is equivalent to using the IN keyword.

Discuss this page in DocCommentXchange. Send feedback about this page using email. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |