How to display the Job groups having total salary greater than the maximum salary for managers?

Oracle Apps Interview QuestionsCategory: SQLHow to display the Job groups having total salary greater than the maximum salary for managers?
Questions Master asked 9 years ago

How to display the Job groups having total salary greater than the maximum  salary for managers?

1 Answers
Shailender Thallam Staff answered 9 years ago

SELECT job,
  SUM(sal)
FROM emp
GROUP BY job
HAVING SUM(sal)>
  (SELECT MAX(sal) FROM emp WHERE job=’MANAGER’
  );