Question d’entretien chez Daffodil Software

Write an SQL query to print third highest salary?

Réponses aux questions d'entretien

Utilisateur anonyme

28 déc. 2017

Another way could be :- select top 1 T.salary from (select top 3 salary from Employees order by salary desc) As T order by T.salary;

Utilisateur anonyme

28 déc. 2017

select T.salary, T.name from (select salary,name, RN = ROW_NUMBER() over ( order by salary desc) from Employees) as T where T.RN in (3);--can change the no(3) here to fetch nth highest salary