How to find second highest salary from table

Total Post:123

Points:615
 357  View(s)
Ratings:
Rate this:
  1. Post:123

    Points:615
    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


Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!