create table table2(list1 int ,list2 int) insert into table2 values(1,1) insert into table2 values(null,5) insert into table2 values(3,null) insert into table2 values(4,null) insert into table2 values(null,7)update table2 set list2=list1 where list2 is nullselect * from table2
update table1 set list2 = list1 where isnull(list2 ,'') = ''
create table #t(list1 int,list2 int) insert into #t(list1,list2) select 1,1 union all select null,5 union all select 3,null union all select 4,null union all select null,7select * from #tupdate #t set list2=list1 where list2 is nullselect * from #tdrop table #t
------------------- update table1 set list2=(select list1 from table1 a where list1=3 or list1=4) where list2 is null
insert into table2 values(1,1)
insert into table2 values(null,5)
insert into table2 values(3,null)
insert into table2 values(4,null)
insert into table2 values(null,7)update table2 set list2=list1 where list2 is nullselect * from table2
insert into #t(list1,list2)
select 1,1 union all
select null,5 union all
select 3,null union all
select 4,null union all
select null,7select * from #tupdate #t set list2=list1
where list2 is nullselect * from #tdrop table #t
update table1 set list2=(select list1 from table1 a where list1=3 or list1=4) where list2 is null