ORACLE统计查询-分组
create table usercount(
userid varchar2(32),
…
…
…
);
select userid,nums,sum(nums) over() as totalNums
from (
select userid,count(userid) as nums
from usercount
group by userid
)
实现按组统计数量和总数量
例如:
类别 - 数量 - 总数量
A - 10 - 58
B - 20 - 58
C - 28 - 58