Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages

TRUNCATE Table


MYSQL TRUNCATE statement removes the complete data without removing its structure.

The TRUNCATE TABLE statement is used when you want to delete the complete data from a table without removing the table structure.

Syntax:

  1. TRUNCATE TABLE  table_name;

Example:

This example specifies how to truncate a table. In this example, we truncate the table “cus_tbl”.

  1. TRUNCATE TABLE  cus_tbl;

Output:

truncatetable1

See the table:

  1. SELECTFROM cus_tbl;

Output:

truncatetable2

Comments

comments