Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Question regarding query
Hi All,
I was reading on some of the Oracle analytical functions. I was playing with this query:
SELECT deptno, ename, sal,
ROUND(average_sal_dept,0) AS average_sal_dept, ROUND(sal - average_sal_dept,0) AS sal_variance FROM (SELECT deptno, ename, sal, AVG(sal) OVER (PARTITION BY deptno) AS average_sal_dept FROM emp);
I'd like to see that that would look like if it had to be done in native SQL, without the help of analytical functions, but I'm having some problems. Anyone care to take a shot at creating that SQL?
Arthur Received on Tue Mar 08 2005 - 08:25:59 CST