MySQL SQLLesson 39Free preview
MySQL ANY
This lesson is part of MySQL · All levels
Summary
ANY (and its synonym SOME) compares a value with each result of the subquery and is worth TRUE when at least one comparison is met. This operator is combined with the comparison operator like =, >, <, and so on. In MySQL, = ANY is equal to IN, whereas > ANY means greater than the smallest value of the resulting subquery.
Key points
- ANY is worth TRUE if at least one result of the subquery satisfies the comparison
- = ANY (subquery) is equal to IN (subquery)
- > ANY means greater than the smallest value of the result of the subquery
- ANY in MySQL can also be written SOME with the same meaning
- Subquery must generate a single column for a valid comparison
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.