alter TableA add Work 列类型;update TableA set Work=(Select TableB.Work from TableB Join TableA on TableB.ID=TableA.ID);
不行啊!提示:work字段名无效!怎么这样?
alter table TableA add Work update TableA set TableA.work=TableB.work from TableA,TableB where TableA.id=TableB.id
select a.*,b.work into c from a,b where a.id=b.id
alter table A add work varchar(20) not null 这句能成功 断开数据库重新连接 再执行 update A set Work= C.Work from (Select B.Id,B.Work from B Join A on B.ID=A.ID) C where A.Id=C.Id;
alter table A add work varchar(20) not null 执行成功后,不用断开数据库 update A set Work= C.Work from (Select B.Id,B.Work from B Join A on B.ID=A.ID) C where A.Id=C.Id; 以上两个语句只有不在一起同时执行就可
alter table TableA add Work update TableA set TableA.work=TableB.work from TableA,TableB where TableA.id=TableB.id搞定!
不行啊!提示:work字段名无效!怎么这样?
set TableA.work=TableB.work
from TableA,TableB
where TableA.id=TableB.id
这句能成功
断开数据库重新连接
再执行
update A set Work= C.Work
from (Select B.Id,B.Work from B Join A on B.ID=A.ID) C
where A.Id=C.Id;
执行成功后,不用断开数据库
update A set Work= C.Work
from (Select B.Id,B.Work from B Join A on B.ID=A.ID) C
where A.Id=C.Id;
以上两个语句只有不在一起同时执行就可
set TableA.work=TableB.work
from TableA,TableB
where TableA.id=TableB.id搞定!