Sollicitatievraag bij Daffodil Software

Write an SQL query to print third highest salary?

Antwoorden op sollicitatievragen

Anoniem

28 dec 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;

Anoniem

28 dec 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