How mysql modifies the field to be allowed to be empty
Most people do not understand the knowledge of this article, "how to modify the field of mysql is allowed to be empty", so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to modify the field of mysql to allow empty" article.
In mysql, you can use the alter table statement with modify to modify the field allowed to be empty. Modify is used to modify the data length, data type and field constraints of the field in the table. The syntax is "alter table table name modify field name field type (length) null;".
The operating environment of this tutorial: windows10 system, mysql5.1 version, Dell G3 computer.
How to modify the field of mysql to allow empty
problem
MySQL modify field is allowed to be empty
Solve
Alter table topic modify state int (4) null
Grammar summary
Alter table table name modify field name field type (length) null
Expand knowledge:
The role of ALTER TABLE
The ALTER TABLE command is used to add, delete, or change columns in an existing data table.
You can also use the ALTER TABLE command to add or remove constraints on an existing data table.
Modify is used to modify the data length, data type and field constraints of the fields in the table.
Mysql method to modify the field to null:
1. Sql syntax
Create a new query and use the statement to set: update p_order set finish_time=null where id='XXXX'
2. Set in navicat for mysql
Double-click to open the p_order table, through the time sorting to find the record that needs to be modified, directly right-click on the finish_time of the record (no need to delete data), right-click will be set to Null (English: Set to Null), the result will have been set to the Null value.
The above is about the content of this article on "how to modify the field allowed to be empty in mysql". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.