MySQL Using TRUNCATE

Aug 26, 2010 Author: Developer

The TRUNCATE statement allows us to delete all the rows from a table. For example:

TRUNCATE TABLE employee;

This query would delete all the employees from the employee table. This is faster than a DELETE statement because it works by dropping the table and re-creating it empty. One thing to bear in mind is that TRUNCATE is not transaction safe.


views 3661
  1. Add New Comment