Tuesday 22 July 2014

Display the Total salaries job wise and department wise in a matrix style report

SELECT 
JOB,
SUM(DECODE(DEPTNO,10,SAL)) DEPT10,
SUM(DECODE(DEPTNO,20,SAL)) DEPT20, 
SUM(DECODE(DEPTNO,30,SAL)) DEPT30,
SUM(SAL) TOTAL
FROM EMP 
GROUP BY JOB;




No comments:

Post a Comment