17.10 - Result Type - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Date and Time Functions and Expressions

Advanced SQL Engine
Teradata Database
Release Number
Release Date
July 2021
Content Type
Programming Reference
Publication ID
English (United States)

Consider the general case of an OVERLAPS comparison, stated as follows.

(S1, E1) OVERLAPS (S2, E2)

The result of OVERLAPS is as follows.

(S1 > S2 AND NOT (S1 >= E2 AND E1 >= E2))
(S2 > S1 AND NOT (S2 >= E1 AND E2 >= E1))
(S1 = S2 AND (E1 = E2 OR E1 <> E2))

For Period data types or derived periods, where p1 is the first Period expression or derived period and p2 is the second Period expression or derived period, the values of S1, E1, S2, and E2 are as follows:

S1 = BEGIN(p1)
E1 = END(p1)
S2 = BEGIN(p2)
E2 = END(p2)