try: Select A1,A2,B1,B2 into #tmp from A,B where 关联条件 truncate table A insert A select * from #tmp
try: alter table A add B1 varchar(10) alter table A add B2 varchar(20) Select A1,A2,B1,B2 into #tmp from A,B where 关联条件 truncate table A insert A select * from #tmp
直接连接就好了 Select A1,A2,B1,B2 into #tmp from A,B
select insert into A(A,B,C,D)values select( a,b,c,d+e+... FROM B)
A(A,B,C,D)及( a,b,c,d+e+... FROM B)是括号中表示表A及表B各自的字段
Select A1,A2,B1,B2 into #tmp from A,B where 关联条件
truncate table A
insert A select * from #tmp
alter table A add B1 varchar(10)
alter table A add B2 varchar(20)
Select A1,A2,B1,B2 into #tmp from A,B where 关联条件
truncate table A
insert A select * from #tmp
Select A1,A2,B1,B2 into #tmp from A,B