Difference between IN and ANY operators in SQL

后端 未结 10 1831
無奈伤痛
無奈伤痛 2020-12-23 11:14

What is the difference between IN and ANY operators in SQL?

10条回答
  •  误落风尘
    2020-12-23 11:58

    ANY and ALL OPERATOR IN SQL SERVER 2008R2.

    Using the > comparison operator as an example, >ALL means greater than every value--in other words, 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.

    Similarly, >ANY means that for a row to satisfy the condition specified in the outer query, the value in the column that introduces the subquery must be greater than at least one of the values in the list of values returned by the subquery.

提交回复
热议问题