PERIOD_INTERSECT
functionsupportedCore SQL functionsReturns the overlapping sub-range of two PERIOD values, or NULL if the periods are disjoint.
Syntax
PERIOD_INTERSECT( <period1>, <period2> )
Parameters
| Name | Required | Description |
|---|---|---|
period1 | required | The first PERIOD value. |
period2 | required | The second PERIOD value. Must have the same element type as period1. |
Returns
A PERIOD value of the same element type, or NULL when the inputs do not overlap.
Usage notes
- The result is [GREATEST(begin1, begin2), LEAST(end1, end2)) when that range is non-empty.
- If the periods are disjoint or only meet at a boundary, the function returns NULL.