second highest salary from employee table code example
Example: how to get employee having maximum experience in mysql
select max(salary), dept_id from employee where salary not in(select max(salary) from employee) group by dept_id;
select max(salary), dept_id from employee where salary not in(select max(salary) from employee) group by dept_id;