已有修入:
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

解决方案 »

  1.   

    已有修改:
    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
      

  2.   

    create proc proc_test
    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
      

  3.   

    create proc proc_test(@cid int)
    as
    begin 
    select * from tbld where cid=@cid
    end