1 Answers
Query to Find Second Highest Salary in Oracle
To find the second highest salary from an employee table in Oracle, you can use the following SQL query:
SELECT MAX(salary) AS second_highest_salary
FROM employees
WHERE salary < (SELECT MAX(salary) FROM employees);
This query first identifies the highest salary in the employee table using the MAX function. Then, it retrieves the maximum salary that is less than the highest salary to get the second-highest salary.
Please login or Register to submit your answer