Get the App
SLTechnology News&Howtos  ›  Database  › 

How mysql adds column data

Shulou Source: shulou.com Published: 2022-06-01 03:30:27 09月24日 Update

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!

Tags: Data content demand value location interest guys partners more knowledge articles industry information information channels questions channels plus one reference change help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker OPPO Reno Huawei Shulou Information vpn