Wednesday, 20 July 2011

How to get 2nd highest salary in mysql?

HI Guys,

There are two way to get solution:

1.) select distinct(salary) from employee order by salary desc limit 1,1 ;
2.) select max(salary) from employee where salary < (select max(salary) from employee);

Thanks

Cheers!

No comments:

Post a Comment