Name

avg() — Compute the numerical average

Common Usage

avg( number )

Description

The avg() aggregate computes the average (mean) numeric value for all non-NULL number values. The aggregate attempts to convert any text or BLOB values into a numeric value. If a conversion is not possible, those rows will be counted with a value of 0.

If all the number values are NULL, avg() will return a NULL.

Get Using SQLite now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.