- Categories:
PERIOD_ LDIFF¶
Returns the portion of the first PERIOD that lies before the second PERIOD begins, or NULL when there is no such remainder.
- See also:
Syntax¶
Arguments¶
period1The PERIOD value to subtract from.
period2The PERIOD value that may cut the right side of
period1. Must have the same element type.
Returns¶
A PERIOD value of the same element type, or NULL.
Usage notes¶
- Returns
[PERIOD_BEGIN(period1), PERIOD_BEGIN(period2))whenPERIOD_BEGIN(period1) < PERIOD_BEGIN(period2) < PERIOD_END(period1). - Otherwise returns NULL (for example, when the second period does not start inside the first).
Examples¶
This example returns the portion of the first period before the second begins. When the second period doesn’t start inside the first, the function returns NULL: