1.ANY关键字
假设any内部的查询语句返回的结果个数是三个,如:result1,result2,result3,那么,
select ...from ... where a > any(...);
->
select ...from ... where a > result1 or a > result2 or a > result3;
 
即a大于子查询中的任意一个,等同于a大于子查询的最小值即可。

2.ALL关键字
ALL关键字与any关键字类似,只不过上面的or改成and。即:
select ...from ... where a > all(...);
->
select ...from ... where a > result1 and a > result2 and a > result3;
 
即a大于子查询中的每一个,等同于a大于子查询的最大值。

3.SOME关键字
some关键字和any关键字是一样的功能。所以:
select ...from ... where a > some(...);
->
select ...from ... where a > result1 or a > result2 or a > result3;
 

相关文章:

  • 2021-10-22
  • 2022-12-23
  • 2021-04-01
  • 2022-12-23
  • 2023-01-09
  • 2022-12-23
  • 2021-07-25
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
  • 2021-09-27
  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案