SELECT name, salary
FROM employees
order by salary desc limit 1,1
and this query should do your job.
First we are sorting the table in descending way so the person with the highest salary is at the top, and the second highest is at the second position. Now limit a,b
means skip the starting a
elements and then print the next b
elements. So you should use limit 1,1
in this case.
Hope this helps.