What's difference between MySql IN and ANY operator?
What's difference between MySql IN and ANY operator?


There is 2 differences between them.


IN is an operator whereis ANY is not, it is a keyword and may be treated as a comparison operator modifier (the same for ALL and SOME).


See Operators and Operator Precedence. IN is listed in both whereas ANY, ALL and SOME are not.


IN may process an expression list whereas ANY cannot.


For example, the code

WHERE t1.id IN ((SELECT id FROM t2), (SELECT id FROM t3))


cannot be converted into = ANY form without subqueries code rewrite.



In all other respects they are complete synonyms.