DELETE - Teradata Database

SQL Data Manipulation Language

Product
Teradata Database
Release Number
16.10
Published
June 2017
Language
English (United States)
Last Update
2018-04-25
dita:mapPath
psg1480972718197.ditamap
dita:ditavalPath
changebar_rev_16_10_exclude_audience_ie.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata® Database

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 SQL Stored Procedures and Embedded SQL .
  • Temporal. For information about syntax compatible with temporal tables, see ANSI Temporal Table Supportand Temporal Table Support .
See also:
  • “DELETE (Positioned Form)” in SQL Stored Procedures and Embedded SQL
  • “DELETE (Temporal Form)” in Temporal Table Support
  • “DELETE (ANSI System-Time Form)” in ANSI Temporal Table Support
  • “DELETE (ANSI Valid-Time Form)” in ANSI Temporal Table Support
  • “DELETE (ANSI Bitemporal Table Form)” in ANSI Temporal Table Support

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.