XQuery - 序列函数

下表列出了XQuery提供的常用序列函数.

Sr .No姓名&描述
1

count($seq as item()*)

按顺序计算项目.

2

sum($ seq as item()*)

返回序列中项目的总和.

3

avg($ seq as item()*)

返回序列中项目的平均值.

4

min($ seq as item()*)

返回序列中的最小值项.

5

max( $ seq as item()*)

返回序列中的最大值项.

6

distinct-values($ seq as item()*)

从序列中返回选择的不同项目.

7

子序列($ seq as item()* ,$ startingLoc为xs:double,$ length为xs:double)

返回提供序列的子集.

8

insert-before($ seq as item()*,$ position as xs:integer,$ insert as item()*)

在序列中插入一个项目.

9

删除($ seq as item()*,$ position as xs:integer)

从序列中删除项目.

10

反向($ seq as item()*)

返回相反的顺序.

11

index-of($ seq as anyAtomicType()*,$ target as anyAtomicType())

将索引作为整数返回,以指示序列中项目的可用性.

12

last()

返回谓词表达式中使用的序列的最后一个元素.

13

position()

在FLOWR表达式中用于获取序列中项目的位置.