17.05 - Example: Current 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

The following current DELETE statement modifies the period of validity for the qualified row from the table because the beginning bound of the period of validity is less than TEMPORAL_DATE. The row becomes a history row.

   CURRENT VALIDTIME DELETE
   FROM Policy
   WHERE Policy_ID = 541145;

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

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