TRUNCATE
Previous  Next


TRUNCATE table_name

This statement will cause the deletion of all rows in table table_name and the reset of the eventual auto increment columns and primary key.

Truncating a table table_name is equivalent to

DROP TABLE table_name;
CREATE TABLE table_name ( ... );

Notice the difference from a simple

DELETE FROM table_name;

which would not reset the auto increment columns and primary key.