mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Update max.md
This commit is contained in:
parent
d1fdc311be
commit
76c78e3cec
@ -4,4 +4,22 @@ toc_priority: 3
|
||||
|
||||
# max {#agg_function-max}
|
||||
|
||||
Calculates the maximum.
|
||||
|
||||
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;
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user