Home > Database > Mysql Tutorial > How to delete all values ​​of a certain field in mysql

How to delete all values ​​of a certain field in mysql

王林
Release: 2020-09-02 15:09:32
Original
9865 people have browsed it

Mysql method to delete all values ​​​​of a certain field: execute the [update table_name set field_name = ''] command. If you want to delete a field, execute the [ALTER TABLE table_name DROP COLUMN field] command.

How to delete all values ​​of a certain field in mysql

Specific method:

(Learning video recommendation: mysql video tutorial)

Delete fields value, you can clear all values ​​

UPDATE table_name SET field_name = '';
Copy after login

(Related recommendations: mysql tutorial)

Delete the field (this field will no longer exist)

ALTER TABLE table_name DROP COLUMN field_name;
Copy after login

The above is the detailed content of How to delete all values ​​of a certain field in mysql. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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