How mysql adds column data
This article mainly introduces mysql how to add column data, the article is very detailed, has a certain reference value, interested friends must read it!
How does mysql add column data
A table that has been created will need to add a column to this table as the requirements change. Of course, you can create a new table to establish a connection to meet the needs.
However, if only one new column is added, you can do the following:
ALTER... ADD COLUMN....
1. Add a new column to the last column of the table
ALTER TABLE `tbname`add COLUMN `state`TINYINT (2) NOT NULL DEFAULT'0' COMMENT'0 to add 1 to edit'
2. Add a new column at the specified location
ALTER TABLE `tbname`add COLUMN `state` TINYINT (2) NOT NULL DEFAULT'0' COMMENT'0 to add 1 to edit 'AFTER `column_ name`
3. Add a new column to the first column
ALTER TABLE `tbname`add COLUMN `state` TINYINT (2) NOT NULL DEFAULT'0' COMMENT'0 for adding 1 for editing 'FIRST; above is all about how mysql adds column data, thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!