SELECT MAX (Income)FROM EmployeeWHERE Salary NOT IN (SELECT Max (Income) FROM Employee);
;WITH CTEAS( SELECT ROW_NUMBER() OVER(ORDER BY Income DESC) ROW_NUM, Income FROM Employee)
SELECT Income FROM CTE WHERE ROW_NUM = 2
select * from (select sal, dense_rank()over(order by sal desc)rank from tempemp) Where rank=2;. -- you can change the rank value -- example if you need 5th max record then rank=5