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 where period1 is a PERIOD(DATE) column:

SELECT * 
FROM employee 
WHERE PRIOR(END(period1)) = DATE '2004-03-04';
ename   dept          period1
-----   -----------   ----------------------------
Jones   Sales         ('2004-01-02', '2004-03-05')
Simon   Sales         ?

The result is:

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