MySQL: How can I empty all fields of a table?
Question by Chematik | 2012-02-24 at 17:41
I have a MySQL table, in which I want to clear the data completely. How do I do that? Is there a specific command? I can not go through each record individually and delete each one separately...
Related Topics
MySQL: Line Breaks in MySQL
Tip | 0 Comments
MySQL: Delete Data from Table - Difference between TRUNCATE, DELETE and DROP
Tutorial | 0 Comments
Send Form Input as an Array to PHP Script
Tip | 0 Comments
MySQL: CSV Export as File stored on the Server
Tutorial | 0 Comments
jQuery: Count characters from multiple input fields
Tip | 0 Comments
MySQL: 3 Ways of showing Table Definition and Structure
Info | 0 Comments
SQLite: Check whether Table exists
Info | 0 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
The command you're looking for is called TRUNCATE and you use it as follows:
Instead of "tab", you just have to insert the name of the table to be deleted. But be careful: The data is then gone and can not be recovered. Thus, you should think about exactly what you're doing!
2012-02-24 at 21:59