Home >Database >Mysql Tutorial >How to implement batch deletion in mysql

How to implement batch deletion in mysql

coldplay.xixi
coldplay.xixiOriginal
2020-09-30 13:24:237968browse

Mysql method to implement batch deletion: use sql to implement batch deletion of data, the code is [DELETE "field name" FROM "table name" WHERE "field name" IN ('value one', 'value two ', ...);].

How to implement batch deletion in mysql

Mysql method to implement batch deletion:

sql syntax for deleting a data:

DELETE "栏位名" 
FROM "表格名" 
WHERE "栏位名" = '值';

Example:

DELETE * from formName where "name" = 'jack';

sqlBatchDelete data syntax:

DELETE "栏位名" 
FROM "表格名" 
WHERE "栏位名" IN ('值一', '值二', ...);

Example:

DELETE * from formName where "name" in ('jack','rose','tom');

More related free learning recommendations: mysql tutorial(view frequency)

The above is the detailed content of How to implement batch deletion in mysql. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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