TRUNCATE TABLE
TRUNCATE TABLE removes all user data from the specified table and its indexes.
Syntax
TRUNCATE TABLE <table_name>;
Limitations
- While the operation runs, the table is locked for reads and writes.
- The operation cannot be interrupted or canceled after it has started.
- The operation cannot be performed if the table has:
Examples
Removes all data from the table with the full path /Root/test/my_table.
TRUNCATE TABLE `/Root/test/my_table`;
Removes all data from table my_table in the current database.
TRUNCATE TABLE `my_table`;
See also
Was the article helpful?
Previous
Next