Check out example codes for "how to get employee having maximum experience in mysql". It will help you in understanding the concepts better.

Code Example 1

SELECT name, MAX(salary) AS salary
  FROM employee
 WHERE salary < (SELECT MAX(salary)
                 FROM employee);

Code Example 2

select max(salary), dept_id from employee where salary not in(select max(salary) from employee) group by dept_id;

Learn ReactJs, React Native from akashmittal.com