Group By Using MIN function

suggest change

Assume a table of employees in which each row is an employee who has a name, a department, and a salary.

SELECT department, MIN(salary) AS "Lowest salary"
FROM employees
GROUP BY department;

This returns each department and the lowest salary in that department, not which one department is the lowest overall. Finding the name of the employee who earns that salary is a different problem. See “groupwise max”.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents