Collections:
Deleting All Rows in a Table in MySQL
How To Delete All Rows in a Table in MySQL?
✍: FYIcenter.com
If you want to delete all rows from a table, you have two options:
The TRUNCATE statement is more efficient the DELETE statement. The tutorial exercise shows you a good example of TRUNCATE statement:
mysql> SELECT COUNT(*) FROM fyi_links; +----------+ | COUNT(*) | +----------+ | 5 | +----------+ 1 row in set (0.08 sec) mysql> TRUNCATE TABLE fyi_links; Query OK, 0 rows affected (0.02 sec) mysql> SELECT COUNT(*) FROM fyi_links; +----------+ | COUNT(*) | +----------+ | 0 | +----------+ 1 row in set (0.00 sec)
2018-01-08, 700👍, 0💬
Popular Posts:
Can You Create a View with Data from Multiple Tables in SQL Server? Can You Create a View with Data ...
How To Recover a Dropped Index in Oracle? If you have the recycle bin feature turned on, dropped ind...
What Are Date and Time Functions in MySQL? MySQL offers a number of functions for date and time valu...
How To Create a Dynamic Cursor with the DYNAMIC Option in SQL Server Transact-SQL? If the underlying...
Where to find tutorials to answer some frequently asked questions on Microsoft SQL Server Transact-S...