Example: Sequenced Delete from a Valid-Time Table - Advanced SQL Engine - Teradata Database

Temporal Table Support

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
cjo1556732840654.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1182
lifecycle
previous
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';

   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')