Skip to content

tm_relative_position_integer

ptrb edited this page May 29, 2013 · 1 revision

Name and Parameters

tm_relative_position_int( PostTIME , PostTIME ) : integer

Description

Determines the relative position of one instance to another and returns the result as integer according to ISO19108's enumeration TM_RelativePosition. The result is one of the following:

Before = 0, Meets = 1, Overlaps = 2, Begins = 3, BegunBy = 4, During = 5, Contains = 6, Equals = 7, OverlappedBy = 8, Ends = 9, EndedBy = 10, MetBy = 11, After = 12

or '-1' if at least one argument-object is not a primitive (see table below).

Please compare Allen's interval algebra.

Examples

-- Calendar system...
SELECT tm_relative_position_int('2013-6-11T9:12','2013-5-30/2016-2-29');
-- result
5

-- ...coordinate system...
SELECT tm_relative_position_int('TCS0028765/9765','TCS0029000/10000');
-- result
2

-- ...or also using an ordinal system.
SELECT tm_relative_position_int('ORD001Neoproterozoic/Ordovician','ORD001Devonian');
-- result
0

Processable Objects

| CAL | TCS | ORD ---|---|---|--- TM_Instant | ✔ | ✔ | ✔ TM_Period | ✔ | ✔ | ✔ MultiInstant | ∼ | ∼ | ∼ MultiPeriod | ∼ | ∼ | ∼ RegularMultiInstant | ∼ | ∼ | ∼ RegularMultiPerid | ∼ | ∼ | ∼ ✔ : Processable

✗ : Call will cause an error

∼ : Callable without error, but returns only a pseudo result

Related functions

tm_relative_position


List of SQL Functions