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!

1 comment:


  1. Wonderful blog & good post.Its really helpful for me, awaiting for more new post. Keep Blogging!
    PHP MYSQL Developers in India

    ReplyDelete