Example: As Of Query on a Transaction-Time Table - Advanced SQL Engine - Teradata Database

Temporal Table Support

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
cjo1556732840654.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1182
lifecycle
previous
Product Category
Teradata Vantage™

To get a snapshot of a transaction-time table where the transaction-time period in the result rows overlap a specific time, use the TRANSACTIONTIME AS OF temporal qualifier in the SELECT statement. For example:

   TRANSACTIONTIME AS OF DATE '2012-06-20' SELECT * FROM Policy_Types;

Policy_Name           Policy_Type
--------------------  -----------
Premium Automobile    AP
Basic Homeowner       HM
Business              B
Basic Automobile      AU
Premium Homeowner     HP

Notice that the Major Medical policy type that was logically deleted from the table on 2012-06-19 does not appear in the result set, though it did appear in Example 5 when the NONSEQUENCED TRANSACTIONTIME qualifier to SELECT was used.