Example: INSERT SELECT and DELETE Operations from Row-Partitioned Table Using PARTITION Column as Search Condition - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

This INSERT SELECT statement copies 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 the copied orders from the orders table.

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