17.10 - Example: MERGE PTI Time-Bucket Table with a non-PTI Table - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - Time Series Tables and Operations

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

In this example, sequenced PTI table src_s, which does not have a time bucket, is merged into non-PTI table tgt_r2.

MERGE INTO
tgt_r2 AS tgt
USING (SELECT * FROM src_s) AS src
ON  tgt.c1 = src.c1
WHEN MATCHED THEN UPDATE SET c2 = 70
WHEN NOT MATCHED THEN
INSERT (src.TD_TIMECODE, src.TD_SEQNO, src.c1, src.c2);