The way to write a delete statement in mysql is: [DELETE FROM table_name [WHERE Clause]]. If the WHERE clause is not specified, all records in the MYSQL table will be deleted. We can delete records in a single table in one go.
#Usually we use the DELETE FROM command to delete records in the MySQL data table.
(Recommended learning: mysql tutorial)
Delete statement syntax:
DELETE FROM table_name [WHERE Clause]
Description:
If the WHERE clause is not specified, all records in the MySQL table will be deleted.
You can specify any condition in the WHERE clause.
You can delete records in a single table at once.
Example:
mysql> use table-1; Database changed mysql> DELETE FROM tbl WHERE id=3; Query OK, 1 row affected (0.23 sec)
The above is the detailed content of How to write delete statement in mysql. For more information, please follow other related articles on the PHP Chinese website!