Reprinted from: http://blog.csdn.net/netcy/article/details/8464503
A common use of the all and any operators is to test the results of a data-only query with a relative comparison operator. They test whether the comparison value matches all or part of the value returned by the subquery. For example, if the comparison value is less than or equal to each value returned by the subquery, <= all will be true, and if the comparison value is less than or equal to any one of the values returned by the subquery, <= any will be true. Some is a synonym for any.
Example:
CREATE TABLE s1 (id int);
CREATE TABLE t1 (id int);
INSERT into S1 select 1;
INSERT into S1 select 2;
INSERT into S1 select 3;
INSERT into T1 select 1;
INSERT into T1 select 2;
INSERT into T1 select 3;
Select S1.id from S1 where S1.id>any (select t1.id from T1)
The returned result is:
2
3
Select S1.id from S1 where S1.id>=any (select t1.id from T1)
The returned result is:
1
2
3
When the all, any, or some operators are used in conjunction with the "=" comparison operator, the subquery can be a data table subquery. At this point, you need to use a data row constructor to provide a comparison value that is compared to the data rows returned by the subquery.
MySQL any,some all (ZZ)