Return the value span ignoring the potential gaps
valueSpan(tnumber) → numspan
SELECT valueSpan(tint '{[1@2001-01-01, 1@2001-01-03), [4@2001-01-03, 6@2001-01-05]}'); -- [1,7) SELECT valueSpan(tfloat '{1@2001-01-01, 2@2001-01-03, 3@2001-01-05}'); -- [1,3])
Return the values of the temporal number or geometry as a set
valueSet(tnumber, tgeo) → {numset,geoset}
SELECT valueSet(tint '[1@2001-01-01, 2@2001-01-03]'); -- {1, 2} SELECT valueSet(tfloat '{[1@2001-01-01, 2@2001-01-03), [3@2001-01-03, 4@2001-01-05)}'); -- {1, 2, 3, 4} SELECT asText(valueSet(tgeompoint '{[Point(0 0)@2001-01-01, Point(0 1)@2001-01-02), [Point(0 1)@2001-01-03, Point(1 1)@2001-01-04)}')); -- {"POINT(0 0)", "POINT(1 1)", "POINT(0 1)"} SELECT asText(valueSet(tgeography '{[Point(0 0)@2001-01-01, Linestring(0 0,1 1)@2001-01-02], [Point(1 1)@2001-01-03, Linestring(0 0,1 1)@2001-01-04]}')); -- {"POINT(0 0)", "LINESTRING(0 0,1 1)", "POINT(1 1)"}
Return the minimum or maximum value
minValue(torder) → base
maxValue(torder) → base
The functions do not take into account whether the bounds are inclusive or not.
SELECT minValue(tfloat '{1@2001-01-01, 2@2001-01-03, 3@2001-01-05}'); -- 1 SELECT maxValue(tfloat '{[1@2001-01-01, 2@2001-01-03), [3@2001-01-03, 5@2001-01-05)}'); -- 5
Return the instant with the minimum or maximum value
minInstant(torder) → base
maxInstant(torder) → base
The function does not take into account whether the bounds are inclusive or not. If several instants have the minimum value, the first one is returned.
SELECT minInstant(tfloat '{1@2001-01-01, 2@2001-01-03, 3@2001-01-05}'); -- 1@2001-01-01 SELECT maxInstant(tfloat '{[1@2001-01-01, 2@2001-01-03), [3@2001-01-03, 5@2001-01-05)}'); -- 5@2001-01-05