Skip to main content
You have an employee table with employee details. You need to
  • get 3rd highest salary
  • get the employee details with 3rd highest salary.
Here is the sample data from employees table.
image.png
You can use the below script to create the test data.
The solution is implemented using the below methods
  • RANK function
  • DENSE_RANK function
  • ROW_NUMBER function
  • OFFSET and FETCH option

Get β€˜N’th highest salary

image.png

Get employee details with β€˜n’ highest salary

image.png