TRUNCATE

Overview

Removes all rows from the specified table.

USAGE

Common Syntax:

TRUNCATE [TABLE] <tbl_name> [, <tbl_name> ...]

DETAILS

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

To execute TRUNCATE, the user must have either the DROP or TRUNCATE privilege.

EXAMPLES

TRUNCATE

To drop a table and re-create it with the same definition, specify the table name:

TRUNCATE customers;

The following statement is equivalent:

TRUNCATE TABLE customers;

TRUNCATE Multiple Tables

To drop and re-create multiple tables, specify the table names separated by commas:

TRUNCATE TABLE customers, invoices;

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES