Example: Delete from a Row-Partitioned Table Using the System-Defined PARTITION Column in the Search Condition - Advanced SQL Engine - Teradata Database

SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Published
January 2021
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
vnq1596660420420.ditamap
dita:ditavalPath
hoy1596145193032.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata Vantage™

This statement deletes all orders in the orders table from partition 1 of the SLPPI table orders.

     DELETE FROM orders
     WHERE orders.PARTITION=1;

If orders was a multilevel partitioned table, you might substitute PARTITION#L1 for PARTITION. However, this substitution would delete all orders in partition 1 of level 1 from the table, which is probably not the result you anticipated.

A DELETE statement for the same multilevel partitioned table specifying PARTITION in place of PARTITION#L1 would only delete the rows in combined partition 1.