--新增字段设置不可为空,且有默认值的话,就会达到你的效果alter table 表名 add 字段名 字段类型(长度精度) default 默认值 not null--如果不希望设置这两个属性就分两步alter table 表名 add 字段名 字段类型(长度精度)update 表名 set 字段名 = 值
update b set id= rownu