The TRUNCATE statement deletes all rows from specified tables.

Synopsis

TRUNCATE TABLE table_name ,

Required Privileges

The user must have the DROP privilege on the table.

Parameters

Parameter Description
table_name The qualified_name of the table you want to truncate.

Example

> SELECT * FROM tbl;
+----+
| id |
+----+
|  1 |
|  2 |
|  3 |
+----+
> TRUNCATE tbl;

> SELECT * FROM tbl;
+----+
| id |
+----+
+----+


Yes No