try:
select * into #tmp from 表1 where A1 = '30'update a set a.a3 = b.a3,a.a4 = b.a4,a.a5 = b.a5,a.a6 = b.a6
from 表1 a
join 表2 b on a.a1 = 30 and b.a1 = 9update a set a.a3 = b.a3,a.a4 = b.a4,a.a5 = b.a5,a.a6 = b.a6
from 表1 a
join #tmp b on a.a1 = 9 and b.a1 = 30drop table #tmp
select * into #tmp from 表1 where A1 = '30'update a set a.a3 = b.a3,a.a4 = b.a4,a.a5 = b.a5,a.a6 = b.a6
from 表1 a
join 表2 b on a.a1 = 30 and b.a1 = 9update a set a.a3 = b.a3,a.a4 = b.a4,a.a5 = b.a5,a.a6 = b.a6
from 表1 a
join #tmp b on a.a1 = 9 and b.a1 = 30drop table #tmp
from table1 a, #t B
where a.a1=30 and b.id=2update table1 set a3=b.a3 and a4=b.a4 and a5=b.a5 and a6=b.a6
from table1 a, #t B
where a.a1=9 and b.id=1drop table #t
from table1 a, #t B
where a.a1=30 and b.id=3update table1 set a3=b.a3 and a4=b.a4 and a5=b.a5 and a6=b.a6
from table1 a, #t B
where a.a1=9 and b.id=2drop table #t