Showing posts with label MSQL. Show all posts
Showing posts with label MSQL. Show all posts

Tuesday, October 4, 2011

Select Top Second Salary

 1. To find exact second salary
         select max(salary) from jos_emp where salary < (select max(salary) from jos_emp)
2. To find all second salary
         select salary from jos_emp where salary=(select max(salary) from jos_emp where salary < (select max(salary) from jos_emp)).