How to display employee name, sal, comm and net pay for those employee whose net pay is greater than or equal to any other employee salary of the company?

Oracle Apps Interview QuestionsCategory: SQLHow to display employee name, sal, comm and net pay for those employee whose net pay is greater than or equal to any other employee salary of the company?
Questions Master asked 10 years ago

How to display employee name, sal, comm and net pay for those employee  whose net pay is greater than or equal to any other employee salary of  the company?

1 Answers
Shailender Thallam Staff answered 10 years ago

SELECT ename,
  sal,
  comm,
  sal+NVL(comm,0) AS netpay
FROM emp
WHERE sal+NVL(comm,0) >ANY
  (select sal from emp
  );