17.05 - Syntax - 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
Teradata Vantage™ - Temporal Table Support describes syntax that is especially relevant to temporal tables. Syntax that is not required, or that is not otherwise specific to temporal tables is generally not shown in this document. For additional syntax, see Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144 , Teradata Vantage™ - SQL Data Manipulation Language, B035-1146 , and Teradata Vantage™ - SQL Data Control Language, B035-1149.
CREATE JOIN INDEX [ database_name. | user_name. ] join_index_name
  standard options AS [ temporal_qualifier ] select_statement
temporal_qualifier
{ valid_time_qualifier [ AND transaction_time_qualifier ] |
  transaction_time_qualifier [ AND valid_time_qualifier ]
}
valid_time_qualifier
[ CURRENT | SEQUENCED | NONSEQUENCED ] VALIDTIME
transaction_time_qualifier
{ CURRENT | NONSEQUENCED } TRANSACTIONTIME
database_name
Specifies an optional database name or user name specified if the join index is to be contained in a database or user other than the current database or user.
user_name
join_index_name
Specifies the name given to the join index created by this statement.
standard options
Specifies standard table and join index options that are the same for temporal and nontemporal tables. For information about these options, see SQL Data Definition Language .
CURRENT VALIDTIME
Specifies that the join index is current in valid time.
The select_statement must project the valid-time column in a join index definition that is current in valid time. If the column is a derived period column, the component columns of the derived period column must be projected.
SEQUENCED VALIDTIME
Specifies that the join index is sequenced in valid time.
The select_statement must project the valid-time column in a join index definition that is sequenced in valid time. If the column is a derived period column, the component columns of the derived period column must be projected.
NONSEQUENCED VALIDTIME
Specifies that the join index is nonsequenced in valid time.
AND
Specifies a keyword for specifying both a valid-time qualifier and a transaction-time qualifier. The valid-time and transaction-time qualifiers, if used together, can be specified in any order.
CURRENT TRANSACTIONTIME
Specifies that the join index is current in transaction time.
The select_statement must project the transaction-time column in a join index definition that is current in transaction time. If the column is a derived period column, the component columns of the derived period column must be projected.
NONSEQUENCED TRANSACTIONTIME
Specifies that the join index is nonsequenced in transaction time.
select_statement
Specifies conventional SELECT statement syntax for creating a join index.