【发布时间】:2019-12-28 14:37:21
【问题描述】:
感谢您帮助理解查询结果的概念 使用 ALL 功能。提前致谢!
带有数据的示例表 = download employee table script & 这里是查询。
select salary, count(*)
from employees
group by salary
having count(*) >= ALL(SELECT count(*) from employees group by salary)
我不明白为什么结果只返回 6 行,计数为 2。
这不应该是having count(*) >= ALL(SELECT count(*) from employees group by salary)
匹配 select sub 之间的每一行并返回 994 的行数?
为什么>= 会返回6 行,而= 或> 会返回0 行?
对此背后的逻辑的详细解释将不胜感激。谢谢!
【问题讨论】: