Home > Software > Databases > SQL-Server
Interview Questions   Tutorials   Discussions   Programs   

SQL-Server - How to find nth highest salary?




524
views
asked mar September 12, 2014 12:32 AM  

How to find nth highest salary?


           

3 Answers



 
answered By Vikas Thakur   0  
select * from (select column1 , rownumber() over (order by column1) as count from tablename) as t
where t.count=n 
flag   
   add comment

 
answered By Vijaykumar   0  

To find Nth Max salary of employee

In sql server:

  • select * from ( select
    *,rn=row_number()over(order by salary desc) from table )x where x.rn=N-- put the nth value
flag   
   add comment

 
answered By   0  

Use the SQL Statement like this

select MAX(Salary) from Employee;

flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert