热线电话:13121318867

登录
2020-12-20 阅读量: 608
sql修改表结构

1. Alter table 数据表名 rename 新表名;

2. Alter table 数据表名 modify 字段名 字段类型 约束条件(firstafter;

3. Alter table 数据表名 change 原字段 新字段 字段类型 约束条件;

4. Alter table 数据表名 add 字段名 字段类型 约束条件(firstafter );

5. Alter table 数据表名 drop 字段名;

6. Alter table 数据表名 add primary key(id);

7. Alter table 数据表名 drop primary key;

8. Alter table 数据表名 drop foreign key 名称;

9. Alter table 表名 add constraint 外键名 foreign key(字段名) references 主表(主键);



0.0000
0
关注作者
收藏
评论(0)

发表评论

暂无数据