SELECT emp_no, salary
FROM salaries
WHERE salary = (SELECT salary
FROM salaries
WHERE to_date = '9999-01-01'
GROUP BY salary
ORDER BY salary DESC LIMIT 1,1 )
SELECT emp_no, salary
FROM salaries
WHERE salary = (SELECT salary
FROM salaries
WHERE to_date = '9999-01-01'
GROUP BY salary
ORDER BY salary DESC LIMIT 1,1 )