Example of interval_term - Analytics Database - Teradata Vantage

SQL Date and Time Functions and Expressions

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-10-30
dita:mapPath
cpk1628111786971.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
pxz1544241488545
lifecycle
latest
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'.