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)

BEGIN returns the beginning bound of a Period data type.

SELECT * FROM employee WHERE BEGIN(period1) = DATE '2004-06-19';

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

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
-----   -----------   ----------------------------
Adams   Marketing     ('2004-06-19', '2005-02-09')
Mary    Development   ('2004-06-19', '2005-01-05')