JSON_AVG

The JSONAVG function returns the average of the numbers in an array.

Syntax

JSON_AVG(json, jsonpath)

Example

The following example returns the average of the elements in the array:

SELECT  JSON_AVG(JSON_ARRAY(1, 2, 3),'$') json
FROM /shared/examples/ds_orders/tutorial/customers
WHERE customerid = 10
Result: 2