max
用于对一组值计算最大值的聚合函数。
示例:
如果你需要一个非聚合函数在两个值中取最大值,请参阅 greatest:
用于对一组值计算最大值的聚合函数。
示例:
SELECT max(salary) FROM employees;
SELECT department, max(salary) FROM employees GROUP BY department;
如果你需要一个非聚合函数在两个值中取最大值,请参阅 greatest:
SELECT greatest(a, b) FROM table;
Was this page helpful?