Highest Average Salary

Construct a query which finds the job with the highest average salary

Questions by shameem_chandu

Showing Answers 1 - 3 of 3 Answers

taaznyonker

  • Mar 31st, 2010
 

If you want to get only highest average salary of particular dept, then you can use

SELECT MAX(AVG(sal)) FROM emp GROUP BY deptno

and if want the dept number too, with the average sal, then query ould look like:

SELECT deptno, AVG(sal)
FROM emp
GROUP BY deptno
HAVING AVG(sal) = (SELECT MAX(AVG(sal)) FROM emp GROUP BY deptno)

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Answer Question

Click here to Login / Register your free account


 
Send   Reset

 

Related Answered Questions

 

Related Open Questions