Example: NEXT Function - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

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

SELECT * 
FROM employee 
WHERE NEXT(END(period1)) = DATE '2004-03-06';

The employee table contains:

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')