Reference Guide > TDV Support for SQL Functions > TDV-Supported JSON Functions > JSON_SUM
 
JSON_SUM
The JSONSUM function returns the sum of the elements in the JSON array.
Syntax
JSON_SUM(json, jsonpath)
Example
The following example calculates the sum of the elements in the JSON array:
SELECT JSON_AVG(JSON_ARRAY(1, 2, 3),'$') json
FROM /shared/examples/ds_orders/tutorial/customers
WHERE customerid = 10
Result: 6