Row Partitioning a Bitemporal Table - Analytics Database - Teradata Vantage

Temporal Table Support

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2023-10-30
dita:mapPath
eud1628112402879.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
fif1472244754791
lifecycle
latest
Product Category
Teradata Vantage™

To row partition a bitemporal table, use the following PARTITION BY clause.

Example: Row partitioning a bitemporal table

   CREATE MULTISET TABLE Policy_Bitemp (
      Policy_ID INTEGER,
      Customer_ID INTEGER,
      Policy_Type CHAR(2) NOT NULL,
      Policy_Details CHAR(40),
      Validity PERIOD(DATE) NOT NULL AS VALIDTIME,
      Policy_Duration PERIOD(TIMESTAMP(6) WITH TIME ZONE) NOT NULL
         AS TRANSACTIONTIME
      )
   PRIMARY INDEX (Policy_ID)
   PARTITION BY CASE_N(
      (END(Validity) IS NULL OR
       END(Validity) >= CURRENT_DATE AT
                        INTERVAL -'12:59' HOUR TO MINUTE) AND
       END(Policy_Duration) >= CURRENT_TIMESTAMP,
       END(Validity) < CURRENT_DATE AT
                       INTERVAL -'12:59' HOUR TO MINUTE AND
       END(Policy_Duration) >= CURRENT_TIMESTAMP,
       END(Policy_Duration) < CURRENT_TIMESTAMP);