站内搜索: 请输入搜索关键词
当前页面: 图书首页 > MySQL Tutorial

MySQL Tutorial

[ Directory ] Previous Section Next Section

Using TRUNCATE

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.

    [ Directory ] Previous Section Next Section