Tieto interview question

Design a SQL query for nth max value.

Interview Answers

Anonymous

Oct 19, 2019

Something like SELECT TOP 6 salary FROM ( SELECT DISTINCT TOP 6 salary FROM employee ORDER BY salary DESC) a ORDER BY salary

1

Anonymous

Dec 15, 2019

Select distinct salary from table order by salary desc limit 6;