insert into 表B
select * from 表A怎么完善下面的语句if(exists(select top 1 0 from 表B where 表B.id=@id))
begin
--存在就更新
update 表B set .... end
else
begin
--不存在就新增
insert into 表B
....
end
select * from 表A怎么完善下面的语句if(exists(select top 1 0 from 表B where 表B.id=@id))
begin
--存在就更新
update 表B set .... end
else
begin
--不存在就新增
insert into 表B
....
end
select * from 表A a
where not exists(select 1 from 表B where id=a.id)update a
set ..
from ta a ,tb b
where a.id = b.id
如果只是单条数据的话我是知道了,现在整个表就不明白了
3楼我明白...