sql server - Check Differences between two Tables with allowed nulls in SQL -
i have 2 different tables, table1 & table2 each own sets of values. want check column see if there differences each other , update
table1 accordingly. have query updates every row regardless if differ in value i'm checking for:
update table1 set value = t2.value table1 t1 inner join table2 t2 on t1.id = t2.id
i tried using where t1.value <> t2.value
since either t1
, t2
can null, function not work properly. want query checks , updates values t1
, t2
different.
... t1.value <> t2.value or (t1.value null , t2.value not null) or (t1.value not null , t2.value null);
Comments
Post a Comment