17.00 - Example: MERGE PTI Time-Bucket Table with a non-PTI Table - Teradata Database

Teradata Vantageā„¢ - Time Series Tables and Operations

prodname
Advanced SQL Engine
Teradata Database
vrm_release
17.00
created_date
June 2020
category
Programming Reference
featnum
B035-1208-170K

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