Comparing Some Subquery Values with ANY

ANY works like ALL (see the preceding section) but instead determines whether a value is equal to, less than, or greater than any (at least one) of the values in a subquery result. The important characteristics of subquery comparisons that use ANY are:

  • ANY modifies a comparison operator in a subquery comparison test and follows =, <>, <, <=, >, or >=; see “Comparing a Subquery Value by Using a Comparison Operator” earlier in this chapter.

  • The combination of a comparison operator and ANY tells the DBMS how to apply the comparison test to the values returned by a subquery. < ANY, for example, means less than at least one value in the subquery result, and > ANY means greater than at least one value in the ...

Get SQL: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.