34,590
社区成员
发帖
与我相关
我的任务
分享
---如果target4存在
insert into
target4
select
*
from
(
select * from target
union all
select * from target1
union all
select * from target2
)t
where
not exists(select 1 from source1 where F1=t.F1)
---如果不存在
select into
target4
from
(
select * from target
union all
select * from target1
union all
select * from target2
)t
where
not exists(select 1 from source1 where F1=t.F1)
第一题麻烦你试试
select * from target
union all
select * from target1
union all
select * from target2
生成target4?
select into
target4
from
(
select * from target
union all
select * from target1
union all
select * from target2
)t
where
not exists(select 1 from source1 where F1=t.F1)