【发布时间】:2015-01-29 14:07:43
【问题描述】:
如何使用 oracle 中的聚合函数计算 模式计数。
我的意思是这样的:
我的数据:
table1:
CITY JOB
++++++++++++++++++++++
Toronto Programmer
Vancouver Manager
Vancouver Manager
Vancouver Tester
Vancouver Tester
Vancouver Tester
Vancouver Tester
New York Manager
New York Manager
New York Manager
New York Tester
我的愿望查询:
select city,
stats_mode(job) sm,
x(job) count_of_stats_mode
from table1
结果:
city sm count_of_stats_mode
++++++++++++++++++++++++++++++++++++++++++++++++++
Toronto Programmer 1
Vancouver Tester 4
New York Manager 3
我需要 x 这是一个函数
只是我不想使用子查询
【问题讨论】:
-
为什么不想使用子查询?
标签: sql oracle oracle-sqldeveloper analysis