Add fields in mysql

1. Add fields in different positions in mysql Add
fields (add after a specific field)
alter table table name add information that needs to be modified/added afer field name (add after which field)

alter table dept Add column name varchar(20) not null default 0 AFTER sex;

Add a field (add the field at the first position)
alter table table name add information that needs to be modified/added first;

alter table dept Add column name varchar(20) not null default 0 first;

2. Modify the field name
alter table table name change the field name field type of the original field to be modified;

alter table dept change name newname varchar(30);

3. Delete the field:
alter table table name drop column column name

alter table user_movement_log drop column Gatewayid;

4. Adjust the field order:

ALTER TABLE user_movement_log CHANGE GatewayId GatewayId int not null default 0 AFTER RegionID;

at last

I know that most junior and middle-level Java engineers want to improve their skills, and they often try to grow by themselves or enroll in classes. However, the tuition fees of nearly 10,000 yuan for training institutions are really stressful. The effect of self-study is inefficient and long, and it is easy to hit the ceiling and stagnate in technology!

Therefore, I collected and sorted out a " Complete Set of Learning Materials for Java Development " and gave it to everyone. The original intention is also very simple, that is, I hope to help friends who want to learn and improve themselves but don't know where to start, and at the same time reduce everyone's burden.

The editor has encrypted: aHR0cHM6Ly9kb2NzLnFxLmNvbS9kb2MvRFVrVm9aSGxQZUVsTlkwUnc==For security reasons, we have encoded the website through base64, and you can decode the URL through base64.

Guess you like

Origin blog.csdn.net/m0_54850467/article/details/126802966