Skip to content
Daniël van Eeden edited this page Mar 13, 2024 · 5 revisions

No such statement in SQL standard, but it's widely supported across implementations:

BigQuery:

TRUNCATE TABLE table_name

DB2:

TRUNCATE [TABLE] table_name
  [DROP STORAGE | REUSE STORAGE]
  [IGNORE DELETE TRIGGERS | RESTRICT WHEN DELETE TRIGGERS]
  [RESTRICT WHEN DELETE TRIGGERS]
  IMMEDIATE

Hive:

TRUNCATE [TABLE] table_name
  [PARTITION partition_spec]

MariaDB:

TRUNCATE [TABLE] table_name
  [WAIT n | NOWAIT]

MySQL:

TRUNCATE [TABLE] table_name

N1QL:

No support for TRUNCATE

PL/SQL:

TRUNCATE TABLE table_name
  [{PRESERVE | PURGE} MATERIALIZED VIEW LOG]
  [{DROP [ALL] | REUSE} STORAGE]
  [CASCADE]

PostgreSQL:

TRUNCATE [TABLE] [ONLY] table_name ["*"] ["," ...]
  [RESTART IDENTITY | CONTINUE IDENTITY]
  [CASCADE | RESTRICT]

Redshift:

TRUNCATE [TABLE] table_name

SingleStoreDB:

TRUNCATE [TABLE] table_name

Snowflake:

TRUNCATE [TABLE] [IF EXISTS] table_name

Spark:

TRUNCATE TABLE table_name
  [PARTITION "(" name "=" value [","...] ")"]

SQLite:

No support for TRUNCATE

TiDB:

TRUNCATE [TABLE] table_name

Transact-SQL:

TRUNCATE TABLE table_name
[WITH "(" PARTITIONS "(" {partition_number | partition_number TO partition_number} ["," ...] ")" ")"]

Trino:

TRUNCATE TABLE table_name
Clone this wiki locally