Home>Article>Database> How to delete all values of a certain field in mysql

How to delete all values of a certain field in mysql

王林
王林 Original
2020-09-02 15:09:32 9734browse

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 = '';

(Related recommendations:mysql tutorial)

Delete the field (this field will no longer exist)

ALTER TABLE table_name DROP COLUMN field_name;

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!

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