Example of interval_term - Advanced SQL Engine - Teradata Database

SQL Date and Time Functions and Expressions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
xmd1556127764262.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1211
lifecycle
previous
Product Category
Teradata Vantageā„¢
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'.