Hi again ,
This time another query for you , another challenging one.
I ve used the Emp table which is normally there in every oracle edition. ( Emp table has columns > empno,ename,sal,deptno etc)
require format needs to contain the Maximum, minimum and the average salaries of dept 10,20 and 30.
The following output is required:
Dept 10 Dept 20 Dept 30
---------- ---------- ----------
5000 3000 2850 <---Max Sal
.. .. .. <---Min sal
.. .. .. <---Avg Sal
But i have been able to generate only the MAX sal , i am not able to figure out how to generate the minimun salary and the average salary.
Query I used:
select max(decode(deptno,10,sal)) "Dept 10",max(decode(deptno,20,sal)) "Dept 20",max(decode(deptno,30,sal)) "Dept 30" from emp;
My Output :
Dept 10 Dept 20 Dept 30
---------- ---------- ----------
5000 3000 2850
please help,
Udit.
This time another query for you , another challenging one.
I ve used the Emp table which is normally there in every oracle edition. ( Emp table has columns > empno,ename,sal,deptno etc)
require format needs to contain the Maximum, minimum and the average salaries of dept 10,20 and 30.
The following output is required:
Dept 10 Dept 20 Dept 30
---------- ---------- ----------
5000 3000 2850 <---Max Sal
.. .. .. <---Min sal
.. .. .. <---Avg Sal
But i have been able to generate only the MAX sal , i am not able to figure out how to generate the minimun salary and the average salary.
Query I used:
select max(decode(deptno,10,sal)) "Dept 10",max(decode(deptno,20,sal)) "Dept 20",max(decode(deptno,30,sal)) "Dept 30" from emp;
My Output :
Dept 10 Dept 20 Dept 30
---------- ---------- ----------
5000 3000 2850
please help,
Udit.