oracle语句,去重、五表联查、统计数量。 Oracle高级查询之over(partition by...)

select distinct
b.FNAME_L2
,c.FPERIODYEAR
,c.FPERIODNUMBER
,d.fname_l1
,count(1) over(partition by b.FNAME_L2,d.fname_l1) 数量
from t_gl_voucherentry a1
,t_gl_voucher a
,t_org_company b
,t_bd_period c
,t_pm_user d
where a1.Fbillid=a.fid
and a.fcompanyid=b.fid
and a.fperiodid=c.fid
and a.fcreatorid=d.fid

oracle语句,去重、五表联查、统计数量。 Oracle高级查询之over(partition by...)
——
——
——
——
select ename 姓名, job 职业, sal 工资, deptno 部门,
first_value(sal) over(partition by deptno) first_sal,
last_value(sal) over(partition by deptno) last_sal,
sum(sal) over(partition by deptno) 部门总工资,
avg(sal) over(partition by deptno) 部门平均工资,
count(1) over(partition by deptno) 部门总数,
row_number() over(partition by deptno order by sal) 序号
from emp;

oracle语句,去重、五表联查、统计数量。 Oracle高级查询之over(partition by...)

Oracle高级查询之over(partition by…)
https://www.cnblogs.com/shengs/p/5954818.html
——
——
——
oracle去重的三个方法
https://www.cnblogs.com/fina1ly/p/9509795.html