Skip to main content

AVG

This function returns the average of the values in a group. It ignores null values.

Syntax​

AVG ( [ DISTINCT ] expression  ) 

Arguments​

expression
An expression of numeric data type category.

DISTINCT
Specifies that AVG only on one unique instance of each value.

Return Type​

Return a FLOAT64.

Examples​

This example finds the average price in the pricing blockchain.

SELECT AVG(price) FROM pricing;

Response:

AVG(PRICE) [FLOAT64]    
68.0990202247198