Update values from one column in same table to another in SQL Server

后端 未结 8 896
忘了有多久
忘了有多久 2020-12-15 03:25

I\'m trying to overwrite values that are found in TYPE1 with values that are found in TYPE2.

I wrote this SQL to try it out, but for some reason it isn\'t updating:<

8条回答
  •  心在旅途
    2020-12-15 03:41

    This works for me

    select * from stuff
    
    update stuff
    set TYPE1 = TYPE2
    where TYPE1 is null;
    
    update stuff
    set TYPE1 = TYPE2
    where TYPE1 ='Blank';
    
    select * from stuff
    

提交回复
热议问题