Comparison Operators Modified by ANY, SOME, or ALL

Comparison operators that introduce a subquery can be modified by the keywords ALL or ANY. SOME is an ISO standard equivalent for ANY.

Subqueries introduced with a modified comparison operator return a list of zero or more values and can include a GROUP BY or HAVING clause. These subqueries can be restated with EXISTS.

ANY=SOME; Comparison operators that introduce a subquery can be modified by the keywords ALL or ANY. SOME is an ISO standard equivalent for ANY.


>ALL;means greater than every value. In other words, it means greater than the maximum value. For example, >ALL (1, 2, 3) means greater than 3.
>ANY;means greater than at least one value, that is, greater than the minimum. So >ANY (1, 2, 3) means greater than 1.


=ANY;It is equivalent to IN

=ALL, It can not display anything


<>ANY;however, differs from NOT IN: < >ANY means not = a, or not = b, or not = c. NOT IN means not = a, and not = b, and not = c.
<>ALL;means the same as NOT IN.

转载于:https://www.cnblogs.com/flysun0311/archive/2013/02/25/2931794.html

猜你喜欢

转载自blog.csdn.net/weixin_34007291/article/details/93444496
今日推荐