17.10 - Example: Proper form of temporal queries using set operations - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - Temporal Table Support

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

The following query would yield an error:

VALIDTIME AS OF DATE '2009-05-06'
SELECT *
FROM v1

MINUS

VALIDTIME AS OF DATE '2009-05-05'
SELECT *
FROM v1

ORDER BY 1;

The following query would run properly to yield the desired results:

SELECT *
FROM v1 VALIDTIME AS OF DATE '2009-05-06'

MINUS

SELECT *
FROM v1 VALIDTIME AS OF DATE '2009-05-05'

ORDER BY 1;