Find Nth Highest Salary

Let us assume we have an employees table as below.


  • First let us find out the highest salary using MAX() function.
  • 2nd highest salary.


  • Nth highest salary.
For example consider N=3 



Similarly we can replace 3 with any N value as per our requirement.

Comments

Popular posts from this blog

Location of SQL setup LOG

Index in SQL Server