HOW TO FIND SECOND HIGHEST SALARY FROM TABLE

Manish Sahu

Total Post:53

Points:265
Posted by  Manish Sahu
 128  View(s)
Ratings:
Rate this:
  1. Manish Sahu

    Post:53

    Points:265
    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!