AVG()

Documentation

Home » Documentation » Using VoltDB

AVG()

AVG() — Returns the average of a range of numeric column values.

Synopsis

AVG( column-expression )

Description

The AVG() function returns the average of a range of numeric column values. The values being averaged depend on the constraints defined by the WHERE and GROUP BY clauses.

Example

The following example returns the average price for each product category.

SELECT AVG(price), category FROM product_list
    GROUP BY category ORDER BY category;