Avg



Returns the average (arithmetic mean) of the values in each group.

Numeric Avg(AggregationArray valuesArray)

Without GROUP BY

When a query has aggregate functions but no Group By, all of the selected documents form a single group.


round-pushpin Groups the synonyms by source word and computes Avg of the target word ids.
SELECT
    SourceWordId,
    Avg(TargetWordId) as Result
FROM
    WordList:Synonym
GROUP BY
    SourceWordId