17.10 - Example of numeric_term * ± interval_primary - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Date and Time Functions and Expressions

Advanced SQL Engine
Teradata Database
Release Number
Release Date
July 2021
Content Type
Programming Reference
Publication ID
English (United States)

This example multiplies a negative interval_primary by a numeric_term and adds the negative result to an interval_term.


The numeric_term in this case is the numeric_primary 2.

The interval_primary is INTERVAL -'30' DAY.

RACE_DURATION is an interval_term, with type INTERVAL DAY TO SECOND.

The processing involves the following stages:

  1. The interval_primary is converted to an exact numeric, or 60 days.
  2. The operations indicated in the arithmetic are performed on the operands (which are both numeric at this point), producing an exact numeric result having the appropriate scale and precision.

    In this example, 60 days are subtracted from RACE_DURATION, which is an INTERVAL type of INTERVAL DAY TO SECOND.

  3. The numeric result is converted back into the indicated INTERVAL type, DAY TO SECOND.