mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-30 02:13:33 -04:00
* Functions starting with A * Functions starting with 'C' * More 'C' functions * Fix tests * Fix missing snippet * DATE_* functions * Apply suggestions from code review Co-authored-by: Bogdan Pintea <pintea@mailbox.org> --------- Co-authored-by: Bogdan Pintea <pintea@mailbox.org>
32 lines
488 B
Text
32 lines
488 B
Text
[discrete]
|
|
[[esql-agg-avg]]
|
|
=== `AVG`
|
|
|
|
*Syntax*
|
|
|
|
[source,esql]
|
|
----
|
|
AVG(column)
|
|
----
|
|
|
|
`column`::
|
|
Numeric column. If `null`, the function returns `null`.
|
|
|
|
*Description*
|
|
|
|
The average of a numeric field.
|
|
|
|
*Supported types*
|
|
|
|
The result is always a `double` no matter the input type.
|
|
|
|
*Example*
|
|
|
|
[source.merge.styled,esql]
|
|
----
|
|
include::{esql-specs}/stats.csv-spec[tag=avg]
|
|
----
|
|
[%header.monospaced.styled,format=dsv,separator=|]
|
|
|===
|
|
include::{esql-specs}/stats.csv-spec[tag=avg-result]
|
|
|===
|