Tamino XML Server Version 9.7
 —  XQuery 4 Reference Guide  —

fn:distinct-values

Return sequence with distinct values.


Syntax

fn:distinct-values(atomicValue* $srcval) => atomicValue
fn:distinct-values(atomicValue* $srcval, string $collation) => atomicValue

Top of page

Description

This function returns the sequence that contains each value at most once by removing from $srcval all but one of a set of equal values. All the values must be of a single type or one if its subtypes; numeric values are promoted to a single common type. Equality must be defined for the type. If the values are string values, then equality is determined according to the collation used. If the values are of type xs:double or xs:float, the values "0.0" and "-0.0" are considered equal. If values are of type xs:date or xs:time and have no timezone information, an implicit timezone is provided by the evaluation context.

If the argument is the empty sequence, the function returns the empty sequence.

You can use an optional collation argument which is used when string comparison is required.

Top of page

Arguments

$srcval

atomic value

$collation

valid collation string literal

Top of page

Examples

Top of page

Related Syntax Constructs

The following construct(s) refer to this construct:

Top of page