17.05 - Example: Sequenced Delete from a Valid-Time Table - Teradata Database

Teradata Vantage™ - Temporal Table Support

prodname
Advanced SQL Engine
Teradata Database
vrm_release
17.00
17.05
created_date
June 2020
category
Programming Reference
featnum
B035-1182-170K

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