:
SQL - TRUNCATE TABLE http://goo.gl/YN7N9Y
SQL - http://goo.gl/viyYFU
SQL TRUNCATE TABLE .
You can also use the DROP TABLE command to delete the full table, but it will remove the full table structure from the database, and you will need to create this table again if you want to save some data.
Syntax:
The basic syntax is TRUNCATE TABLEas follows:
TRUNCATE TABLE table_name;
Example: Consider a CUSTOMERS table with the following entries:
+----+----------+-----+-----------+----------+
| ID | NAME | AGE | ADDRESS | SALARY |
+----+----------+-----+-----------+----------+
| 1 | Ramesh | 32 | Ahmedabad | 2000.00 |
| 2 | Khilan | 25 | Delhi | 1500.00 |
| 3 | kaushik | 23 | Kota | 2000.00 |
| 4 | Chaitali | 25 | Mumbai | 6500.00 |
| 5 | Hardik | 27 | Bhopal | 8500.00 |
| 6 | Komal | 22 | MP | 4500.00 |
| 7 | Muffy | 24 | Indore | 10000.00 |
+----+----------+-----+-----------+----------+
The following is an example of truncation:
SQL > TRUNCATE TABLE CUSTOMERS;
Now the CUSTOMERS table is truncated, and the following result will be output from the SELECT statement:
SQL> SELECT * FROM CUSTOMERS;
Empty set (0.00 sec)
user1630938
source
share