update b set b.d=a.d,.. from a inner join b on a.a=b.a and a.b=b.b and a.c=b.cinsert into b select a.* from a left join b on a.a=b.a and a.b=b.b and a.c=b.c where b.a is null
一个SQL语句完成不了:update B set d = a.D from B, A where B.a=A.a and B.b=A.b and B.c=A.c insert into B elect * from A where not exists(select 1 from B where a=A.a and b=A.b and c=A.c)
update b set b.d=a.d from b,a where a.a=b.a and a.b=b.a and a.c=b.c insert into b select * from a where exsits (select * from b where a.a=b.a and a.b=b.a and a.c=b.c ) 没具体测试过,但这样应该可以的
恩 但是 为什么 我用 select * from A where not exists(select 1 from B where a=A.a and b=A.b and c=A.c) 直接在查询器里执行 怎么把A的数据都查出来了,应该查出来的是 A中没包含B的那些数据啊 怎么解释????????
update B set d = a.D from B Left Join A On B.a=A.a and B.b=A.b and B.c=A.cinsert into B Select * from A where not exists(select 1 from B where a=A.a and b=A.b and c=A.c)
有谁能解释下吗 select * from A where not exists(select 1 from B where a=A.a and b=A.b and c=A.c)
B
set
d = a.D
from
B,
A
where
B.a=A.a and B.b=A.b and B.c=A.c
insert into B
elect * from A where not exists(select 1 from B where a=A.a and b=A.b and c=A.c)
insert into b select * from a where exsits (select * from b where a.a=b.a and a.b=b.a and a.c=b.c
)
没具体测试过,但这样应该可以的
set d = a.D
from B
Left Join A
On B.a=A.a and B.b=A.b and B.c=A.cinsert into B
Select * from A where not exists(select 1 from B where a=A.a and b=A.b and c=A.c)