17.10 - Row Partitioning a Valid-Time Table - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - Temporal Table Support

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1182-171K
Language
English (United States)

To row partition a valid-time table, use the following PARTITION BY clause.

Example: Row Partitioning a Valid-Time Table

   CREATE MULTISET TABLE Policy(
      Policy_ID INTEGER,
      Customer_ID INTEGER,
      Policy_Type CHAR(2) NOT NULL,
      Policy_Details CHAR(40),
      Validity PERIOD(DATE) NOT NULL AS VALIDTIME
      )
   PRIMARY INDEX(Policy_ID)
   PARTITION BY
     CASE_N(
      END(Validity)>= CURRENT_DATE AT INTERVAL - 12:59' HOUR TO MINUTE,
                   NO CASE);