Return sum of a sequence of numbers.
fn:sum(sequence $sequence) => double
This aggregate function returns the sum of all numeric values in a
sequence. If the argument is an empty sequence, the function returns the
numerical value 0
.
$sequence |
sequence of numerical values |
---|
This query returns as sum of the sequence values the numerical value
"4.2E1" of type xs:double
:
let $a := (17, 23, 11, -10) return sum($a)
The following construct(s) refer to this construct: