How to get nth Highest salary of Employee in Department wise

select * from
(
select EmployeeName,  DeptID,  Sal,  Rank()
over (Partition BY EmployeeName  order by Sal DESC, DeptID DESC)
as Rank
from
Employee
) tmp
where Rank = @n

Comments

Popular posts from this blog

How to Convert Word Document to PDF using C#

How to Implement a Simple Chatbot Using ChatGPT in a C# WinForms Application?

Sql query to get counts by quarterly and half yearly