Write query to find out the second largest salary from employee table?

 Posted by CGN007 on 5/30/2012 | Category: Sql Server Interview questions | Views: 1861 | Points: 40

SELECT MAX(emp_salary) FROM employee WHERE emp_salary<(SELECT MAX(emp_salary) FROM employee)

Here the sub query find-outs the largest salary.The inner query will display the salary which is less than the largest salary.So the output of the query is second largest salary.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response

More Interview Questions by CGN007