Tamino XML Server Version 9.7
 —  XQuery 4 Reference Guide  —

fn:avg

Return average of a sequence of numbers.


Syntax

fn:avg(sequence $sequence) => double

Top of page

Description

This aggregate function returns the average of the numeric values of the nodes of $sequence. The nodes of the sequence must all evaluate to numbers. If a node evaluates to the empty sequence it is discarded.

Top of page

Argument

$sequence

sequence of nodes

Top of page

Example

let $a := (17, 23, 11)
return avg($a)

Top of page

Related Syntax Constructs

The following construct(s) refer to this construct:

Top of page