Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Question regarding query

Question regarding query

From: <amerar_at_iwc.net>
Date: 8 Mar 2005 06:25:59 -0800
Message-ID: <1110291959.919826.81180@l41g2000cwc.googlegroups.com>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US