How to update column with null value

前端 未结 13 688
被撕碎了的回忆
被撕碎了的回忆 2020-12-13 05:08

I am using mysql and need to update a column with a null value. I have tried this many different ways and the best I have gotten is an empty string.

Is there a speci

13条回答
  •  孤街浪徒
    2020-12-13 05:44

    In the above answers, many ways and repetitions have been suggested for the same. I kept looking for an answer as mentioned is the question but couldn't find here.

    Another way to put the above question "update a column with a null value" could be "UPDATE ALL THE ROWS IN THE COLUMN TO NULL"

    In such a situation following works

    update table_name
    set field_name = NULL
    where field_name is not NULL;
    

    is as well is not works in mysql

提交回复
热议问题