Update max.md

This commit is contained in:
alexey-milovidov 2021-04-28 04:37:44 +03:00 committed by GitHub
parent d1fdc311be
commit 76c78e3cec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
```