mysql truncate
The TRUNCATE() function is not a built-in function in MySQL. It may refer to the TRUNCATE TABLE statement, which is used to remove all rows from a table in MySQL.
The syntax for TRUNCATE TABLE is:
TRUNCATE TABLE table_name;
This statement deletes all rows from the specified table and resets the auto-increment counter to zero. Unlike the DELETE statement, TRUNCATE TABLE is a faster way to remove data from a table because it does not generate any transaction logs. However, it cannot be undone, and it requires the DROP privilege on the table.
Example:
TRUNCATE TABLE employees;
This statement removes all rows from the employees table.
原文地址: https://www.cveoy.top/t/topic/E5V 著作权归作者所有。请勿转载和采集!