Delete Statement

SQL statement that removes one or more rows from a table.

See Delete statement

Teradata support calling more than one table in theFROMclause, Snowflake does not. Therefore, it is necessary to use theUSINGclause to refer to the extra tables involved in the condition.

Teradata

IN -> Teradata_01.sql
DEL FROM MY_TABLE ALL;
DEL FROM MY_TABLE_2 WHERE COL1 > 50;
DELETE T1 FROM TABLE1 T1, TABLE2 T2 WHERE T1.ID = T2.ID;
DELETE FROM TABLE1 T1, TABLE2 T2 WHERE T1.ID = T2.ID;
DELETE T1 FROM TABLE2 T2, TABLE1 T1 WHERE T1.ID = T2.ID;
DELETE FROM TABLE1 WHERE TABLE1.COLUMN1 = TABLE2.COLUMN2

Snowflake

OUT -> Teradata_01.sql
DELETE FROM
MY_TABLE;

DELETE FROM
MY_TABLE_2
WHERE
COL1 > 50;

DELETE FROM
TABLE1 T1
USING TABLE2 T2
WHERE
T1.ID = T2.ID;

DELETE FROM
TABLE1 T1
USING TABLE2 T2
WHERE
T1.ID = T2.ID;

DELETE FROM
TABLE1 T1
USING TABLE2 T2
WHERE
T1.ID = T2.ID;

DELETE FROM
TABLE1
WHERE
TABLE1.COLUMN1 = TABLE2.COLUMN2;

Known Issues

1. DEL abbreviation unsupported

The abbreviation is unsupported in Snowflake but it is translated correctly by changing it to DELETE.

No related EWIs.

Last updated