Databases Reference
In-Depth Information
Time Period Relationships
Along a Common Timeline
Excludes
Before
Meets
|-| |-----|
|-|-----|
Figure 14.21 P
1
[excludes] T
1
.
the same as a request for policies which ended [before] the 2009
Diabetes Management Wellness Program began.
The SQL written to fulfill this request is:
SELECT * FROM V_Allen_Example
WHERE (pol_epis_end_dt
<¼
wp_eff_beg_dt
OR DATEADD(MONTH,
þ
1, wp_eff_beg_dt)
<¼
pol_eff_beg_dt)
Point in Time to Point in Time Queries
Another special set of Allen relationships consists of the
relationships between two points in time, T
1
and T
2
. There are
only three such relationships. One point in time may precede
another and be non-contiguous with it, or precede the other
and be contiguous with it, or be the same as the other.
T
1
[before] T
2
The predicate for this relationship, as it holds between two
points in time, expressed as points in time, is:
((T
1
þ f
CTD(1))
<
T
2
)
It says that T
1
comes before T
2
, and that there is at least one
clock tick between it and T
2
. Note that because of the require-
ment for this one clock tick gap, the Allen relationship [before]
does not mean the same thing as “before” in ordinary language.
The inverse of this relationship is: T
1
[before
1
]T
2
. The pred-
icate for this relationship, as it holds between two points in time,
expressed as points in time, is:
((T
1
-
f
CTD(1))
>
T
2
)
It says that T
1
comes after T
2
, and that there is at least one
clock tick between it and T
2
.