SQL> select * from emp01;
EMP_ID DEPT_ID EMP_NAME YEARS SALARY ----- ----- ---------- ---------- ---------- E01 D01 なまえ1 3 150 E02 D02 なまえ2 7 200 E03 D03 なまえ3 7 300 E04 D02 なまえ4 7 400 E05 D03 なまえ5 3 500 E06 D02 なまえ6 3 600
SQL> select 2 corr( years, salary ) 3 from emp01;
CORR(YEARS,SALARY) ------------------ -0.36639675
SQL> select 2 dept_id, corr( years, salary ) 3 from emp01 4 group by dept_id;
DEPT_ID CORR(YEARS,SALARY) ----- ------------------ D01 D02 -0.8660254 D03 -1