This query finds the second highest salary from a table of employee salaries. It uses a subquery to select the top 2 highest salaries ordered descending by salary. Then it finds the minimum salary from the outer query, which will be the second highest since the highest is excluded.
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
35 views
SQL
This query finds the second highest salary from a table of employee salaries. It uses a subquery to select the top 2 highest salaries ordered descending by salary. Then it finds the minimum salary from the outer query, which will be the second highest since the highest is excluded.