MySQL alter table modify column failing at rows with null values

前端 未结 4 1835
野的像风
野的像风 2021-02-20 03:39

I have a table with about 10K rows, which I am trying to alter so that the field fielddelimiter is never null. I am attempting to do an alter statement, expecting a

4条回答
  •  粉色の甜心
    2021-02-20 04:30

    First remove any null values

    UPDATE merchant_ftp_account SET fielddelimiter='t' WHERE fielddelimiter IS NULL;
    

    Then

    ALTER TABLE merchant_ftp_account MODIFY COLUMN `fielddelimiter` char(1) NOT NULL DEFAULT 't';
    

提交回复
热议问题