17.10 - Example - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Date and Time Functions and Expressions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1211-171K
Language
English (United States)

BEGIN returns the beginning bound (jdbegin) of a derived period called jobduration created using the following SQL statement:

CREATE TABLE employee(id INTEGER,
                      name VARCHAR(50),
                      jdbegin DATE NOT NULL FORMAT 'YYYY-MM-DD',
                      jdend   DATE NOT NULL FORMAT 'YYYY-MM-DD',
                      PERIOD FOR jobduration(jdbegin,jdend)
  )PRIMARY INDEX(id);

The following SQL statements:

INSERT INTO employee(1025,'John',DATE'2011-01-02',DATE'2012-05-02');
SELECT BEGIN (jobduration) FROM employee;

returns:

  jdbegin
__________
2011-01-02