14 lines
399 B
MySQL
14 lines
399 B
MySQL
|
/*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)));
|