我希望直接用SQL語句,而不要用觸發器,或存儲過程

解决方案 »

  1.   

    delete B inner join A on A.料号=B.料号
      where exists(select * from A )
      

  2.   

    delete from b where  a.料號=b.料號 and a.廠商=b.廠商 and a.幣別=b.幣別
      

  3.   

    lsqkeke(可可):你的方法一個都沒刪除掉!
    lsp69(浪子神剑):提示語法出錯!
    謝了,我再想想辦法
      

  4.   

    delete from b where 料號+廠商+幣別 exists (select 料號+廠商+幣別 from a)
      

  5.   

    delete from b where exists (select 1 from a where 料號=b.料號 and 廠商=b.廠商 and 幣別=b.幣別)
      

  6.   

    謝謝erp1998(三清)及各位了,搞定了,不過小小改動了一下把exits改成in了!