---
title: "Find nth highest salary  in Sql Serever"  
description: "Find nth highest salary  in Sql Serever"  
author: "Anonymous User"  
published: 2015-12-09  
updated: 2015-12-09  
canonical: https://www.mindstick.com/forum/33705/find-nth-highest-salary-in-sql-serever  
category: "database"  
tags: ["sql server", "sql", "sql server 2008", "sql server 2012"]  
reading_time: 1 minute  

---

# Find nth highest salary  in Sql Serever

I want to use Find nth [highest salary](https://www.mindstick.com/forum/34652/how-can-get-alternate-highest-salary-or-any-record-in-a-table-in-sql-server) in [Sql](https://www.mindstick.com/articles/13115/types-of-keys-in-sql-or-oracle-database) Serever please help me.

## Replies

### Reply by Anonymous User

We can also use the TOP keyword (for databases that support the TOP keyword, like SQL Server) to find the [nth highest](https://answers.mindstick.com/qa/116427/how-to-find-nth-highest-salary) salary.

```
SELECT TOP 1 Emp_ID,Emp_Name,Emp_Sal,LocationFROM (      SELECT DISTINCT TOP 1 Emp_ID,Emp_Name,Emp_Sal,Location      FROM Employee      ORDER BY Emp_Sal DESC      ) AS EmpORDER BY Emp_Sal
```

To understand the query above, first look at the subquery, which simply finds the N highest salaries in the Employee table and arranges them in descending order. Then, the outer query will actually rearrange those values in ascending order, which is what the very last line “ORDER BY Salary” does, because of the fact that the ORDER BY Default is to sort values in ASCENDING order. Finally, that means the Nth highest salary will be at the top of the list of salaries, which means we just want the first row, which is exactly what “SELECT TOP 1 Salary”

```

```


---

Original Source: https://www.mindstick.com/forum/33705/find-nth-highest-salary-in-sql-serever

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
