Example: interval_term - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905
The definition for interval_term can be expressed in four forms:
  • interval_factor
  • interval_term * numeric_factor
  • interval_term / numeric_factor
  • numeric_term * interval_factor

This example uses the second definition.

SELECT (INTERVAL '3-07' YEAR TO MONTH) * 4;

The interval_term in this operation is INTERVAL '3-07' YEAR TO MONTH.

The numeric_factor is 4.

The processing involves the following stages:

  1. The interval is converted into 43 months as an INTEGER value.
  2. The INTEGER value is multiplied by 4, giving the result 172 months.
  3. The result is converted to '14-4'.