select*fromemployee;+------+--------+|Id |name |+------+--------+|100 |Ram | |20"/> select*fromemployee;+------+--------+|Id |name |+------+--------+|100 |Ram | |20">

Home >Database >Mysql Tutorial >What is the purpose of the MySQL DELETE command?

What is the purpose of the MySQL DELETE command?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBforward
2023-09-16 16:33:051055browse

MySQL DELETE 命令的用途是什么?

MySQL DELETE command is used to delete rows from a table. It is used with WHERE clause.

Syntax

DELETE From Table_name WHERE Condition;

Example

In the following example, we have deleted the rows with id >= 100 in the table "employee".

mysql> select * from employee;
+------+--------+
| Id   | name   |
+------+--------+
| 100  | Ram    |
| 200  | Gaurav |
| 300  | MOHAN  |
+------+--------+
3 rows in set (0.00 sec)

mysql> delete from employee where id >=100;
Query OK, 3 rows affected (0.06 sec)

mysql> select * from employee;
Empty set (0.00 sec)

The above is the detailed content of What is the purpose of the MySQL DELETE command?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete