Row-Partitioned Tables Primary Condition Definition - Teradata Database

SQL Data Manipulation Language

Product
Teradata Database
Release Number
15.10
Language
English (United States)
Last Update
2018-10-06
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata® Database

For row-partitioned tables, the partitioning column set must be a component of the primary condition definition. For example, consider the MERGE request for the following target and source table definitions:

     CREATE TABLE t1 (
       a1 INTEGER, 
       b1 INTEGER, 
       c1 INTEGER) 
     PRIMARY INDEX (a1) 
     PARTITION BY (c1);
 
     CREATE TABLE t2 (
       a2 INTEGER, 
       b2 INTEGER, 
       c2 INTEGER);
 
     MERGE INTO t1
     USING t2
       ON a1=b2 AND c1=10 AND b1<b2
     WHEN MATCHED THEN
       UPDATE SET b1=b2;

For this MERGE request, the primary condition is a1=b2 AND c1=10, and b1<b2 is a secondary condition.