Aggregate Functions
The following table lists the aggregate functions supported by SecMaster SQL syntax.
Function |
Function Description |
---|---|
COUNT([ ALL ] expression | DISTINCT expression1 [, expression2]*) |
By default or with the keyword ALL, returns the number of input rows where the expression is not NULL. Using DISTINCT calculates the count after removing duplicates. |
COUNT(*) | COUNT(1) |
Returns the number of input rows. |
AVG([ ALL | DISTINCT ] expression) |
By default or with the keyword ALL, returns the average value (arithmetic mean) of the expression across all input rows. Using DISTINCT calculates the count after removing duplicates. |
SUM([ ALL | DISTINCT ] expression) |
By default or with the keyword ALL, returns the sum of the expression across all input rows. Using DISTINCT calculates the count after removing duplicates. |
MAX([ ALL | DISTINCT ] expression) |
By default or with the keyword ALL, returns the maximum value of the expression across all input rows. Using DISTINCT calculates the count after removing duplicates. |
MIN([ ALL | DISTINCT ] expression ) |
By default or with the keyword ALL, returns the maximum value of the expression across all input rows. Using DISTINCT calculates the count after removing duplicates. |
ROW_NUMBER() |
Assigns a unique sequence number to each row within the window partition, starting from 1. (for example, 1, 2, 3, 4, and 5) |
FIRST_VALUE(expression) |
Returns the first value in a set of ordered values. |
LAST_VALUE(expression) |
Returns the last value in a set of ordered values. |
LISTAGG(expression [, separator]) |
Concatenates the values of string expressions and places a separator value between them. The separator is not added at the end of string. The default value of separator is a comma (,). |
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