I am trying to display the maximum average salary; however, I can\'t seem to get it to work.
I can get a list of the average salaries to display with:
select max(a.high)Avg_highest_salary,
e.dept
from (
select avg(salary) high,dept from emp group by dept) a,
emp e
where a.dept = e.dept
group by e.dept
order by max(a.high) desc
It will show the high Average highest salary first with dept
If you don't want to show the Salary with Dept then you can use this
select max(avg(salary)) max_avg_salary
from emp
group by dept;