select 2nd highest salary
Ravi Patel
Select an image from your device to upload
Select top 1 salary from employee where salary in (select top 2 salary from employee order by Salary desc )
You can do this use dense_rank(),using dense_rank() you can find nth highest salarywith cte as(Select Salary,dense_rank() over (Order by Salary desc) as rankSal)Select distinct salary from cte where rankSal=2