Syntax
Parameters
| Parameter | Description | Supported input types |
|---|---|---|
<expression> | A value used for the MAX function | Any |
<partition_by> | An expression used for the PARTITION BY clause. | Any |
Return Types
Same as input typeExample
The example below queries test scores for players in various grade levels. Unlike a regularMAX() aggregation, the window function highlights how each player individually compares to the highest game score for their level.
| nickname | level | current_score | highest_score |
|---|---|---|---|
| kennethpark | 9 | 76 | 95 |
| sabrina21 | 7 | 90 | 98 |
| burchdenise | 5 | 79 | 99 |
| ymatthews | 6 | 85 | 93 |
| rileyjon | 8 | 80 | 84 |