This example uses a numeric_factor with an INTERVAL YEAR TO MONTH typed value.
SELECT INTERVAL '10-02' YEAR TO MONTH * 12/5;
The numeric_factor in this operation is the integer 12.
The processing involves the following stages:
- The interval is multiplied by 12, giving the result as an interval.
- The interval result is divided by 5, giving '24-04'.
Note that very different results are obtained by using parentheses to change the order of evaluation as follows.
SELECT INTERVAL '10-02' YEAR TO MONTH * (12/5);
The numeric_factor in this operation is (12/5).
The processing involves the following stages:
- The numeric_factor is computed, giving the result 2.4, which is truncated to 2 because the value is an integer by default.
- The interval is multiplied by 2, giving '20-04'.