Watch the 7.3 Webinar On-Demand
This new release brings updates to Universal Storage, query optimization, and usability that you won’t want to miss.


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 )


  • DISTINCT: optional keyword. If present, will average the unique values.
  • expression: any numerical expression. This may be a column name, the result of another function, or a math operation

Return Type

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


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

select avg(list_price * discount) from items;

select avg(age) from employees group by job_title;