1. 程式人生 > >oracle————————資料統計函式

oracle————————資料統計函式

select * 
from (
select e.empno,e.ename,e.deptno,e.job,e.sal,
count(e.empno) over (partition by e.deptno) count,
round(avg(e.sal) over (partition by e.deptno),2) avg,
max(e.sal) over (partition by e.deptno) max,
min(e.sal) over (partition by e.deptno) min,
sum(e.sal) over (partition by e.deptno) sum
from emp e
) e1
where e1.empno = 7369;