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

To query a valid-time table such that no special temporal treatment is given to the valid-time column, use the NONSEQUENCED VALIDTIME temporal qualifier in the SELECT statement. For example:

NONSEQUENCED VALIDTIME SELECT * FROM Policy;

 Policy_ID  Customer_ID  Policy_Type  Policy_Details       Policy_Term
----------  -----------  -----------  -------------------  -------------------------
    541008    246824626  AP           STD-CH-345-NXY-00     ('09/10/01', '99/12/31')
    540944    123344567  HM           STD-PL-332-YXY-00     ('07/02/03', '99/12/31')
    497201    304779902  AU           STD-CH-524-WXY-00     ('05/02/14', '06/02/14')
    541145    616035020  B            STD-CH-348-YXN-00     ('09/12/03', '10/12/01')
    497201    304779902  AU           STD-CH-524-WXY-01     ('06/02/14', '07/02/14')
    497201    304779902  AU           STD-CH-524-WXY-02     ('07/02/14', '99/12/31')
    541077    766492008  HP           STD-CH-344-YXY-00     ('09/12/21', '99/12/31')

The valid-time column, Policy_Term, is treated as a regular column with a period data type, and appears in the result set. All rows in the table are returned, even if they are history rows.