create a matrix query to display the job, the salary for that job based on department number and the total salary for that job, for departments 20,50,80, and 90,giving each column and appropriate heading.
select * from (select job,sum(decode(deptno,20,sal)) dept20, sum(decode(deptno,50,sal)) dept50, sum(decode(deptno,80,sal)) dept80, sum(decode(deptno,90,sal)) dept90, sum(sal) total_sal from emp group by job) order by 1
RE: create a matrix query to display the job, the sala...
hello sir
Question: create a matrix query to display the job the salary for that job based on department number and the total salary for that job for departments 20 50 80 and 90 giving each column and appropriate heading.
RE: create a matrix query to display the job, the sala...
SELECT DISTINCT job SUM(CASE deptno WHEN 20 THEN sal END) "Dept 20" SUM(CASE deptno WHEN 50 THEN sal END) "Dept 50" SUM(CASE deptno WHEN 80 THEN sal END) "Dept 80" SUM(sal) "Total" FROM emp GROUP BY job;
RE: create a matrix query to display the job, the salary for that job based on department number and the total salary for that job, for departments 20,50,80, and 90,giving each column and appropriate heading.
select * from (select job sum(decode(deptno 20 sal)) dept20 sum(decode(deptno 50 sal)) dept50 sum(decode(deptno 80 sal)) dept80 sum(decode(deptno 90 sal)) dept90 sum(sal) total_sal from emp group by job) order by 1
RE: create a matrix query to display the job, the salary for that job based on department number and the total salary for that job, for departments 20,50,80, and 90,giving each column and appropriate heading.
select job_id salary department_id avg(salary) "Average Salary" from employees where department_id in(20 80 90 50) group by job_id salary department_id order by job_id
RE: create a matrix query to display the job, the salary for that job based on department number and the total salary for that job, for departments 20,50,80, and 90,giving each column and appropriate heading.
select job deptno salary
sum(salary) over( partition by deptno job) dep_sum_sal