How to get the Nth highest salary of an employee?

preview_player
Показать описание
1. Full .NET Interview Course

C# / ASP.NET Core / MVC / API - Top 500 Interview Questions

Don't worry if course not helping you, Udemy has 30 days Free Refund Policy.

2. Quick Revision Book (PDF format)

Top 500 .NET Interview Questions - OOPS/ C#/ ASP.Net/ MVC/ SQL /.Net Core /Web API

50% Discount Applied on above link.

My best wishes are with you.
Комментарии
Автор

Better way is using CTE with DENSE_RANK method instead of using subquery; since this is a classic way; Well explained

lentg
Автор

Select * from Employees order by Salary desc offset 2 row fetch next 1 row only
By this also we can get any desired result

umar-official
Автор

Some one asked me what charindex will do please add this

Devdumplings