mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-13 01:41:59 +00:00
433 B
433 B
slug | sidebar_position | title |
---|---|---|
/en/sql-reference/aggregate-functions/reference/max | 162 | max |
Aggregate function that calculates the maximum across a group of values.
Example:
SELECT max(salary) FROM employees;
SELECT department, max(salary) FROM employees GROUP BY department;
If you need non-aggregate function to choose a maximum of two values, see greatest
:
SELECT greatest(a, b) FROM table;