Aggregate Functions
This topic describes the aggregate functions supported by StoneDB.
Function | Description | Example |
---|---|---|
SUM(expression) | Returns the sum of values in field expression. | SELECT SUM(money) FROM account; |
AVG(expression) | Returns the average value of field expression. | SELECT AVG(money) FROM account; |
COUNT(expression) | Returns a count of the number of returned records. expression can be set to a field or an asterisk (*). | SELECT COUNT(*) FROM account; |
MAX(expression) | Returns the maximum value in field expression. | SELECT MAX(money) FROM account; |
MIN(expression) | Returns the minimum value in field expression. | SELECT MIN(money) FROM account; |