已有修入:
update A set jp=jp+b.jp from tbld a,tblm b where a.cid=b.cid
没有插入:
insert tbld(cid,jp) select cid,jp where cid not in (select cid from tblm)
最后删除:
delete from tblm
update A set jp=jp+b.jp from tbld a,tblm b where a.cid=b.cid
没有插入:
insert tbld(cid,jp) select cid,jp where cid not in (select cid from tblm)
最后删除:
delete from tblm
update A set jp=jp+b.jp from tbld a,tblm b where a.cid=b.cid
没有插入:
insert tbld(cid,jp) select cid,jp from tblm where cid not in (select cid from tblm)
最后删除:
delete from tblm
as
begin
update A set jp=jp+b.jp from tbld a,tblm b where a.cid=b.cidinsert tbld(cid,jp) select cid,jp from tblm where cid not in (select cid from tblm)delete from tblm
end
as
begin
select * from tbld where cid=@cid
end