SUM()

Documentation

VoltDB Home » Documentation » Using VoltDB

SUM()

SUM() — Returns the sum of a range of numeric column values.

Synopsis

SUM( column-expression )

Description

The SUM() function returns the sum of a range of numeric column values. The values being added together depend on the constraints defined by the WHERE and GROUP BY clauses.

Example

The following example uses the SUM() function to determine how much inventory exists for each product type in the catalog.

SELECT category, SUM(quantity) AS inventory FROM product_list
    GROUP BY category ORDER BY category;