min

Aggregate function that calculates the minimum across a group of values.

Example:

  1. SELECT min(salary) FROM employees;
  1. SELECT department, min(salary) FROM employees GROUP BY department;

If you need non-aggregate function to choose a minimum of two values, see least:

  1. SELECT least(a, b) FROM table;