DELETE - Teradata Database - Teradata Vantage NewSQL Engine

SQL Data Manipulation Language

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2019-05-03
dita:mapPath
fbo1512081269404.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata Vantage™

Purpose

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 “DELETE (Positioned Form)” in 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

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.

Syntax - Basic Form





Syntax - Join Condition Form





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.