ANY or SOME with Subselects
A subselect comparison test uses the same six operators (=, <, <=, >, >=, <>) discussed previously.
In many RDBMS systems, ANY and SOME are synonymous in meaning and perform the same function.
Therefore, we will use ANY in our descriptions, and it is understood that SOME serves the same purpose.
The ANY and SOME operators return a TRUE value:
> when at least one row in a subselect matches the value comparison.
The ANY and SOME operators return a FALSE value:
> when no rows in a subselect match the value comparison,
> or when a subselect returns an empty result set.
The ANY and SOME operators return a NULL value:
> when any rows in a subselect are NULL, then the operation evaluates to NULL (not TRUE or FALSE).
Format: SELECT select_columns
FROM tables
WHERE value operator [ANY|SOME] (subselect);
The expression < ANY is the same as column function < MAX.
The expression > ANY is the same as column function > MIN.
> DB2, Oracle, Postgre SQL, and SQL Server support ANY or SOME.
> MySQL does not support ANY or SOME.