fn:min

Return object with minimum value from item sequence.

Top of page

Related Syntax Constructs

The following construct(s) refer to this construct:


Syntax

fn:min(sequence $sequence) => anySimpleType?
fn:min(sequence $sequence, string $collation) => anySimpleType?

Description

This aggregate function returns the minimum value of all values in a sequence that are of a single type or one of its subtypes, for which the lt operator is defined. For numeric values type promotion is used to coerce all values to a single common type. If the argument is the empty sequence, the function returns the empty sequence.

Argument

$sequence

a sequence of items

$collation

optional valid collation string literal

Examples

  • Get minimum value from sequence with numeric values:

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