The MIN()
function returns the smallest value of an expression when using SELECT.
Structure
SELECT MIN(EXPRESSION)
FROM TABLE
WHERE [CONSTRAINTS]
Example
Building on our previous examples, let’s find out which position in Company A has the lowest salary:
SELECT p.position_name, MIN(s.salary) min_salary from
salaries s
JOIN positions p on p.ID = s.positions_id;