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)

Assume the following query is executed on the employee table PERIOD(DATE) column period1:

SELECT * FROM employee WHERE LAST(period1) = DATE '2004-01-04';
ename   dept          period1
-----   -----------   ----------------------------
Jones   Sales         ('2004-01-02', '2004-01-05')
Adams   Marketing     ('2004-06-19', '2005-02-09')
Mary    Development   ('2004-06-19', '2005-01-05')
Simon   Sales         ('2004-06-22', '2005-01-07')

The result is:

ename   dept          period1
-----   -----------   ----------------------------
Jones   Sales         ('2004-01-02', '2004-01-05')