16.20 - DELETE - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ Time Series Tables and Operations

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Content Type
Programming Reference
Publication ID
B035-1208-162K
Language
English (United States)
Last Update
2019-05-02

You cannot specify the TD_TimeBucket column in the WHERE clause of the DELETE statement. For complete information about DELETE syntax, see Teradata Vantage™ SQL Data Manipulation Language , B035-1146 .

Example: DELETE Rows from a PTI Table

Below is the table definition for this example:
CREATE TABLE ocean_buoy (
   TD_TIMEBUCKET BIGINT NOT NULL GENERATED SYSTEM TIMECOLUMN,
   TD_TIMECODE   TIMESTAMP(1) NOT NULL GENERATED TIMECOLUMN,
   BUOY_ID       INTEGER,
   TEMPERATURE   INTEGER)
PRIMARY TIME INDEX (TIMESTAMP(1), DATE '2016-10-15', HOURS(1), NONSEQUENCED);
These statements add data to the table:
INSERT INTO ocean_buoy(TIMESTAMP '2016-10-16 10:33:12.1', 1, 33);
INSERT INTO ocean_buoy(TIMESTAMP '2016-10-16 11:44:12.1', 2, 34);
INSERT INTO ocean_buoy(TIMESTAMP '2016-10-16 12:55:12.1', 3, 35);
This statement deletes the last inserted row:
DELETE FROM ocean_buoy
       WHERE TD_TIMECODE = TIMESTAMP '2016-10-16 12:55:12.1';