Example: UPDATE Using a PERIOD Value Constructor - Analytics Database - Teradata Vantage

SQL Data Manipulation Language

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-04-05
dita:mapPath
pon1628111750298.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esx1472246586715
lifecycle
latest
Product Category
Teradata Vantage™

The following example uses tables t1 and t2, which are defined as follows:

     CREATE TABLE t1 (
       c1 INTEGER
       c2 PERIOD(DATE))
     UNIQUE PRIMARY INDEX (c1);

     CREATE TABLE t2 (
       a INTEGER
       b DATE
       c DATE)
     UNIQUE PRIMARY INDEX (a);

The following two UPDATE requests both use a PERIOD value constructor:

     UPDATE t1
     SET c2 = PERIOD(DATE '2007-02-03', DATE '2008-02-04'));
     UPDATE t1 FROM t2
     SET c2 = PERIOD(b,c)
     WHERE t2.a = 2;