DELETE Statement | SQL Statements | Teradata Vantage - DELETE - 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™

Removes one or more rows from a table.

There are four forms of the DELETE statement.
  • Basic - removes one or more rows from a table. The basic form of DELETE is ANSI-compliant and you should use it for all delete statements that reference either a single table or reference tables other than the one deleted from only by subqueries in the condition.
  • Join Condition - removes rows from a table when the WHERE condition directly references columns in tables other than the one from which rows are to be deleted; that is, if the WHERE condition includes a subquery or references a derived table.

    Use this form when the request specifies a condition that directly references more than one table.

  • Positioned is invoked from an embedded SQL application. For details, see Teradata Vantage™ - SQL Stored Procedures and Embedded SQL, B035-1148.
  • Temporal. For information about syntax compatible with temporal tables, see Teradata Vantage™ - ANSI Temporal Table Support, B035-1186 and Teradata Vantage™ - Temporal Table Support, B035-1182.
See also:
  • DELETE (Positioned Form) in Teradata Vantage™ - SQL Stored Procedures and Embedded SQL, B035-1148
  • DELETE (Temporal Form) in Teradata Vantage™ - Temporal Table Support, B035-1182
  • DELETE (ANSI System-Time Form) in Teradata Vantage™ - ANSI Temporal Table Support, B035-1186
  • DELETE (ANSI Valid-Time Form) in Teradata Vantage™ - ANSI Temporal Table Support, B035-1186
  • DELETE (ANSI Bitemporal Table Form) in Teradata Vantage™ - ANSI Temporal Table Support, B035-1186

ANSI Compliance

The basic form of DELETE is ANSI SQL:2011-compliant with extensions.

The join condition form of DELETE is a Teradata extension to the ANSI SQL:2011 standard.

Required Privileges

You must have the DELETE privilege on the table.

If the DELETE statement specifies WHERE conditions, you must also have the SELECT privilege on all tables and views through which they are referenced.

Use caution when granting the privilege to delete data through a view. Data in fields that might not be visible to the user is also deleted when a row is deleted through a view.