Home > Database > Mysql Tutorial > body text

What is the purpose of the MySQL DELETE command?

WBOY
Release: 2023-09-16 16:33:05
forward
915 people have browsed it

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;
Copy after login

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)
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!