17.10 - Example: Sequenced Delete from 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)

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