Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

Write a SQL query to find the 10th highest employee salary from an Emp table.Note: u may assume that there are at least 10 records in the Emp table?

user-image
Question added by antonios awadallah , HRMS Application Consultant , HITS Technologies
Date Posted: 2016/12/11
nithin koshy
by nithin koshy , Database administrator -INTERN , Syncron

SELECT * FROM(SELECT ROWNUMBER()OVER(ORDER BY SALARY DESC)RN,SAL FROM EMP )

WHERE RN=10;

Muhammad Rehan Farooq Usmani
by Muhammad Rehan Farooq Usmani , Senior Software Engineer , khushhali bank limited pakistan

select top 10 a.salary

from (

select  distinct top salary from emp order by salary desc

)a

order by a.salary

 

 

chiranjeevi marada
by chiranjeevi marada , Database Administrator , Franklin Templeton International Services India Pvt Ltd

SELECT TOP1 salary 

FROM (

SELECT DISTINCT TOP salary 

FROM EMP

ORDER BY salary DESC) a

ORDER BY salary

المصطفى عبد السلام آدم نور الدين
by المصطفى عبد السلام آدم نور الدين , BI Developer and Data Analyst , بنك الخليج السودان

This query will do that: Select Top 10 * From Emp

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.