16.20 - Example: MERGE PTI Time-Bucket Table with a non-PTI Table - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantageā„¢ Time Series Tables and Operations

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Content Type
Programming Reference
Publication ID
B035-1208-162K
Language
English (United States)
Last Update
2019-05-02

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