MS SQL Server interview questions | TechInterviews
to get 4th max salary the coding is: select max(salary) from emp where salary notin(select top(4-1)salary from emp order by salary desc; to get any nth max salary the coding is: select max(salary) from emp where salary notin(select top(n-1)salary from emp
www.techinterviews.com |