Example: INSERT SELECT and DELETE Operations from Row-Partitioned Table Using PARTITION Column as Search Condition - 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-12-13
dita:mapPath
pon1628111750298.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esx1472246586715
lifecycle
latest
Product Category
Teradata Vantageā„¢

This example performs an INSERT SELECT to copy orders from partitions 1 and 2 of the SLPPI orders table into the old_orders table using the system-defined PARTITION column as a search condition, and then deletes them from orders in the second part of the multistatement request.

     INSERT INTO old_orders
     SELECT *
     FROM orders
     WHERE orders.PARTITION IN (1,2)
    ;DELETE FROM orders
     WHERE orders.PARTITION IN (1,2);