---
title: "How to find second highest salary from table"  
description: "How to find second highest salary from table"  
author: "Manish Kumar"  
published: 2017-11-08  
updated: 2020-09-23  
canonical: https://www.mindstick.com/interview/23307/how-to-find-second-highest-salary-from-table  
category: "database"  
tags: ["sql server"]  
reading_time: 1 minute  

---

# How to find second highest salary from table

there are many ways to solve this problem one of them is

```
select MAX(Salary) from Employee WHERE Salary NOT IN (select MAX(Salary) from Employee
```

and anotother is

```
SELECT TOP 1 salary FROM (
   SELECT TOP 2 salary
   FROM employees
   ORDER BY salary DESC) AS emp
ORDER BY salary ASC
```

\

## Answers

### Answer by Manish Kumar

there are many ways to solve this problem one of them is

```
select MAX(Salary) from Employee WHERE Salary NOT IN (select MAX(Salary) from Employee
```

and anotother is

```
SELECT TOP 1 salary FROM (
   SELECT TOP 2 salary
   FROM employees
   ORDER BY salary DESC) AS emp
ORDER BY salary ASC
```

\


---

Original Source: https://www.mindstick.com/interview/23307/how-to-find-second-highest-salary-from-table

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
