17.00 - 17.05 - Example - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Date and Time Functions and Expressions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
17.05
Release Date
June 2020
Content Type
Programming Reference
Publication ID
B035-1211-170K
Language
English (United States)

If we assume that the employee table, created by the following SQL statement:

CREATE MULTISET TABLE employee(
 id INTEGER,
 name VARCHAR(50),
 dept INTEGER,
 tt PERIOD(TIMESTAMP(6)WITH TIME ZONE) NOT NULL AS TRANSACTIONTIME
 )
 PRIMARY INDEX(id);

contains the following row, a real period:

INSERT INTO employee(102, 'John', 222);

The following SELECT statement:

SELECT * FROM employee WHERE END(tt) IS UNTIL_CLOSED;

returns:

id     name   dept
--------------------
  102   John    222