These two query will produce same results:
|
![]()
|
Overflow: |
Note: the query below did not group deptno.
SELECT ename,empno, sal,round( AVG(sal) over (), 2) AGVSAL, deptno FROM emp
|
Partition BY grouped deptno together, and also resembled the results
with Order BY clause.
|
Order by clause may mimic Partition By clause. SELECT ename,empno, sal,round( AVG(sal) over ( order by deptno), 2) AGVSAL, deptno FROM emp
|
SELECT ename,empno, sal,round( AVG(sal) over ( partition BY
deptno), 2) AGVSAL, deptno FROM emp
|