Updated on 2026-11-06 GMT+08:00
max
Function
The max function is used to return the maximum value.
Syntax
max(col)
Parameters
| Parameter | Mandatory | Description |
|---|---|---|
| col | Yes | Column values can be of any type except BOOLEAN. |
Return Values
Returns a value of type DOUBLE.
The return value type is the same as the col type. Return rules are as follows:
- If col is NULL, that row is excluded from the calculation.
- If col is of type BOOLEAN, it is not allowed in the computation.
Examples
- Calculate the maximum inventory (items) across all items. Example command:
select max(items) from warehouse;
Result:
_c0 900
- Used with GROUP BY to find the maximum inventory for each warehouse. Example command:
select warehouseId, max(items) from warehouse group by warehouseId;
Result:
warehouseId _c1 city1 200 city2 300 city3 400
Parent topic: Aggregate Functions
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot