7.9 计算模式

问题:查找某个列中值的模式(数学中的模式概念就是对于给定的数据集出现最频繁的元素)。
例如,查找DEPTNO 20中工资模式。例如下列工资:

select sal from emp
where deptno = 20
group by sal
having count(*) >=all (select count(*) from emp
where deptno =20 group by sal);

原文地址:https://www.cnblogs.com/liang545621/p/7523279.html