Example: Sequenced Delete from a Valid-Time 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™

If the period of applicability of the sequenced delete in the last example had been (PERIOD '(2005-05-01, 2005-06-01)'), such that it was smaller than, and fully contained within, the period of validity of policy 497201, the policy row would be split into two rows, preserving the validity for periods that were not deleted:

   SEQUENCED VALIDTIME PERIOD '(2005-05-01, 2005-06-01)' DELETE
   FROM Policy;

   NONSEQUENCED VALIDTIME
   SELECT Policy_ID, Customer_ID, Validity
   FROM Policy
   WHERE Policy_Type = 'AU';

Result:

   Policy_ID  Customer_ID  Validity
   ---------  -----------  ------------------------
      497201    304779902  ('05/02/14', '05/05/01')
      497201    304779902  ('05/06/01', '06/02/13')
      541145    616035020  ('09/12/03', '10/12/01')
      541077    766492008  ('09/12/21', '99/12/31')
      541008    246824626  ('09/10/01', '99/12/31')