mysql ”Invalid use of null value“ 解决方法

解决办法

1)添加新列,设置列的结构属性。

alter table information add column 'yyy' varchar(255) not null first; -新添加列yyy至第一列.

2)将出错的列内容复制到新列中并删除出错列

update information set yyy='编号';  ---将'编号'列的所有值复制到yyy列.

alter table information drop '编号';  ---删除出错的列.

3)修改新列名为出错的列名

alter table information change 'yyy' '编号' varchar(255) not null;

posted @ 2022-02-10 10:13  锐洋智能  阅读(276)  评论(0编辑  收藏  举报