max
This function is used to return the maximum value.
Syntax
max(col)
Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
col |
Yes |
Any type except BOOLEAN |
The value can be of any type except BOOLEAN. |
Return Values
The return value is of the DOUBLE type.
The return type is the same as the type of col. The return rules are as follows:
- If the value of col is NULL, the row is not involved in calculation.
- If the value of col is of the BOOLEAN type, it cannot be used for calculation.
Example Code
- Calculates the maximum inventory (items) of all offerings. An example command is as follows:
select max(items) from warehouse;
The command output is as follows:
_c0 900
- When used with group by, it returns the maximum inventory of each warehouse. An example command is as follows:
select warehourseId, max(items) from warehouse group by warehourseId;
The command output is as follows:
warehouseId _c1 city1 200 city2 300 city3 400
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot