These two query will produce same results:
  • SELECT ename,empno, sal,round( AVG(sal) over ( order by deptno), 2) AGVSAL, deptno FROM emp
  • SELECT ename,empno,deptno, sal,round( AVG(sal) over (), 2) AGVSAL FROM emp order by deptno
  • Order BY clause as a final make over

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