XQuery – Sequence Functions

The following table lists the commonly used sequence functions provided by XQuery.

Sr.NoName & Description
1count Function Counts the items in a sequence.
2sum Function Returns the sum of the items in a sequence.
3avg Function Returns the average of the items in a sequence.
4min Function Returns the minimum valued item in a sequence.
5max Function Returns the maximum valued item in a sequence.
6distinct-values Function Returns select distinct items from a sequence.
7subsequence Function Returns a subset of provided sequence.
8insert-before Function Inserts an item in a sequence.
9remove Function Removes an item from a sequence.
10reverse Function Returns the reversed sequence.
11index-of function Returns indexes as integers to indicate availability of an item within a sequence.
12last Function Returns the last element of a sequence when used in predicate expression.
13position Function Used in FLOWR expressions to get the position of an item in a sequence.

Leave a Reply