17.00 - 17.05 - Example of numeric_term * interval_primary - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Date and Time Functions and Expressions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
17.05
Release Date
June 2020
Content Type
Programming Reference
Publication ID
B035-1211-170K
Language
English (United States)

In this format, the value for numeric_term can include instances of multiplication and division.

SELECT 12/5 * INTERVAL '10-02' YEAR TO MONTH;

The numeric_term is 12/5.

The interval_primary is INTERVAL '10-02' YEAR TO MONTH.

The processing involves the following stages:

  1. The numeric_term 12/5 is evaluated, giving 2.4, which is truncated to 2 because the value is an integer by default.
  2. The interval_primary is multiplied by 2, giving '20-04'.