select max(salary) from Employeedetails where salary not in (select top 2 salary from Employeedetails order by salary desc )
WITH CTE AS ( SELECT ROW_NUMBER() OVER (ORDER BY RATE DESC)[Rank],Rate from HumanResources.EmployeePayHistory ) SELECT * FROM CTE WHERE [Rank]=3
select MIN(salary) from Table_1 where salary in (select distinct Top 3 (salary) from Table_1 order by salary desc)
select id ,name,salary as topSalary from ( SELECT top 3 id ,name,salary FROM table order by salary desc ) AS tbl ORDER BY salasy ASC
WITH rk AS ( SELECT dense_rank() OVER (ORDER BY RATE DESC)[Rank],Rate from HumanResources.EmployeePayHistory ) SELECT * FROM rk WHERE [Rank]=3
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)