Use this query
SELECT
MIN(s.Payment), e.EmpName, e.EmpID
FROM
dbo.Employee e
INNER JOIN
Salary s ON e.EmpID = s.EmpID
WHERE
e.EmpID IN (SELECT TOP 2 EmpID FROM dbo.Salary ORDER BY Payment DESC)
5
solved find 2nd highest salary in sql [closed]