Temporal Queries in Set Operations - Advanced SQL Engine - Teradata Database

Temporal Table Support

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
cjo1556732840654.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1182
lifecycle
previous
Product Category
Teradata Vantage™

When temporal tables are referenced in queries involving set operations (UNION, INTERSECT, MINUS, and EXCEPT) all queries inherit the temporal qualifier from the topmost query.

If temporal qualifications are required at the level of individual queries, add them to the FROM clause or place the query with the required qualification in a derived table.

Example: Proper form of temporal queries using set operations

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;