programming-examples/sql/SubqueriesHRDatabase/Write a query to display all the information for those employees whose id is any id who earn the second highest salary.sql
2019-11-18 14:05:53 +01:00

14 lines
399 B
SQL

/*Write a query to display all the information for those employees whose id is any id who earn the second highest salary.
*/
SELECT *
FROM employees
WHERE employee_id IN
(SELECT employee_id
FROM employees
WHERE salary =
(SELECT MAX(salary)
FROM employees
WHERE salary <
(SELECT MAX(salary)
FROM employees)));