SQL set values of one column equal to values of another column in the same table

前端 未结 5 2008
[愿得一人]
[愿得一人] 2021-02-02 05:11

I have a table with two DATETIME columns.

One of them is never NULL, but one of them is sometimes NULL.

I need to write a query which will set all the NULL rows

5条回答
  •  春和景丽
    2021-02-02 05:30

    I don't think that other example is what you're looking for. If you're just updating one column from another column in the same table you should be able to use something like this.

    update some_table set null_column = not_null_column where null_column is null
    

提交回复
热议问题