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

A nonsequenced delete applies no special temporal logic to the delete operation or row selection, and operates on a valid-time table as a conventional delete would operate on a nontemporal table:

Start from the same valid-time table that was used for the sequenced delete examples:

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

Each of the following nonsequenced DELETE statements physically deletes one row from the table:

   NONSEQUENCED VALIDTIME DELETE
   FROM Policy
   WHERE Customer_ID = 304779902;

   NONSEQUENCED VALIDTIME DELETE
   FROM Policy
   WHERE BEGIN(Validity) = DATE '2007-02-03';