17.10 - Example: Nonsequenced 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)

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