DELETE Statement | SQL Statements | Teradata Vantage - 17.05 - DELETE - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Release Date
January 2021
Content Type
Programming Reference
Publication ID
B035-1146-175K
Language
English (United States)

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.