Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

Write a query to find second highest salary of an employee?

user-image
Question ajoutée par Muhammad Shahid Farooq , Software Engineer, System Integrator , ForeVision Business Solutions
Date de publication: 2017/03/16

SELECT Name FROM   Employees WHERE  Salary = (SELECT MIN(Salary) FROM   (SELECT DISTINCT TOP (2) Salary FROM   Employees ORDER  BY Salary DESC) T);

Muhammad Arshad Gondal
par Muhammad Arshad Gondal , Daputy Manager IT , NOON SUGAR MILLS LIMITED

SELECT MAX(SALARY) FROM MASTER WHERE SALARY NOT in(SELECT MAX(SALARY) from master)

 

Muhammad Waqar Arif
par Muhammad Waqar Arif , Senior Database Architect , FINCA Microfinance Bank Limited

SELECT TOP 1 Salary FROM ( SELECT TOP 2 Salary FROM Employee ORDER BY Salary DESC) AS Employee ORDER BY Salary ASC;

Atiqul Islam
par Atiqul Islam , Sr Software Engineer , Prism Informatics Ltd

SELECT MAX(Salary) FROM Employee WHERE Salary NOT IN (SELECT MAX(Salary) FROM Employee )

Shakir Ali
par Shakir Ali , Full Stack Developer , https://www.freelancer.com

Select Top 1 Salary From

(Select Distinct Top 2 

Salary from tblEmployee

Order by Salary)

Result

Order by Salary 

More Questions Like This