码迷,mamicode.com
首页 > 其他好文 > 详细

7.09 计算模式

时间:2017-09-14 23:44:40      阅读:198      评论:0      收藏:0      [点我收藏+]

标签:dep   group by   频繁   问题:   count   数学   select   where   数据   

问题:查找某个列中值的模式(数学中的模式概念就是对于给定的数据集出现最频繁的元素)。
例如,查找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);

7.09 计算模式

标签:dep   group by   频繁   问题:   count   数学   select   where   数据   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!