mysql 在指定的字段后面追加字段
举个栗子:alter table inquiry add error_code varchar(3) after add_time;
说明:alter table + 表名 + add + 要添加的字段 字段类型 + after + 要跟随的字段名
alter table t_adviser_info add hold int COMMENT '0持有,1未持有' after stockname
alter table t_adviser_info add profit int comment "0盈利,1亏损" after hold
alter table t_adviser_info add weight int comment "0轻仓,1重仓" after profit
注意 Int,comment,和after 的位置
alter table tablename add column columnname varchar(64) not null after somecolumn;
tablename指的是表名,columnname指的是新增字段名,somecolumn指的是表中原有的字段。no null 表示新增字段不能为空。varchar(64) 设置新增字段类型和长度。
alter table image_approval_result add customerType int comment "0投保人,1被保人" after customerNo;
alter table image_approval_result add sceName varchar(20) comment "人脸的场景编码" after busType;
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)