How to display employee name and his salary whose salary is greater than highest average of department number?

Oracle Apps Interview QuestionsCategory: SQLHow to display employee name and his salary whose salary is greater than highest average of department number?
Questions Master asked 10 years ago

How to display employee name and his salary whose salary is greater than highest average of department number?

1 Answers
Shailender Thallam Staff answered 10 years ago

SELECT ename,deptno,sal FROM emp WHERE sal>  (SELECT MAX(AVG(sal)) FROM emp GROUP BY deptno  );