PERIOD_RDIFF
functionsupportedCore SQL functionsReturns the portion of the first PERIOD that lies after the second PERIOD ends, or NULL when there is no such remainder.
Syntax
PERIOD_RDIFF( <period1>, <period2> )
Parameters
| Name | Required | Description |
|---|---|---|
period1 | required | The PERIOD value to subtract from. |
period2 | required | The PERIOD value that may cut the left side of period1. Must have the same element type. |
Returns
A PERIOD value of the same element type, or NULL.
Usage notes
- Returns [PERIOD_END(period2), PERIOD_END(period1)) when PERIOD_BEGIN(period1) < PERIOD_END(period2) < PERIOD_END(period1).
- Otherwise returns NULL (for example, when the second period does not end inside the first).