2017  Kodetalk | Feedback | Privacy Policy | Terms | About
userimage

How to get top 5 salary data of an employee using sql query

How to get top 5 salary data of an employee using sql query
userimage

If the table name is EMPLOYEE:

SELECT *
FROM EMPLOYEE
WHERE
(
  sal IN
  (
    SELECT TOP (5) sal
    FROM EMPLOYEE as table1
    GROUP BY sal
    ORDER BY sal DESC
  )
)

Answer is