举个栗子: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;

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐