Product Solutions Support
Try MemSQL

AVG

Aggregate function. Calculate the average value from a set of numbers. NULL values are ignored. If no values can be averaged, this function returns NULL.

AVG ( [DISTINCT] expression )

Arguments

Return Type

A double if the input type is double, otherwise decimal.

Examples

memsql> select avg(table_rows) from information_schema.tables;
+-----------------+
| avg(table_rows) |
+-----------------+
|       1540.0000 |
+-----------------+
1 row in set (2.87 sec)


memsql> select avg(list_price * discount) from items;

memsql> select avg(age) from employees group by job_title;
Was this article useful?