Thursday 12 July 2012

how to calculate 2nd highest salary in MySql

 You will get the second highest 
salary of the table :---
 
select max(sal) from table_name where sal<(select max(sal)
from table_name)
  
OR
 
select max(salary ) from emp table where sal<(select max
(salary)from emp table)

No comments:

Post a Comment

Note: only a member of this blog may post a comment.