跳至主要内容

min

计算一组值中的最小值的聚合函数。

示例

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

如果您需要非聚合函数来选择两个值的最小值,请参阅 least

SELECT least(a, b) FROM table;