表A:
mchId price (mchId 为primary key)表B:
mchId price (mchId 为primary key)要求:
A.mchId=B.mchId 相同时将A.price 该成B.price

解决方案 »

  1.   

    表A:
    mchId price (mchId 为primary key)表B:
    mchId price (mchId 为primary key)要求:
    A.mchId=B.mchId 相同时将A.price 该成B.priceupdate A
    set price = (select price from B where A.mchId=B.mchId)
    where exists (select 1 from B where A.mchId=B.mchId)
      

  2.   

    不太明白.不知道是不是你想要的
    select A.mchId,B.price from A,B where A.mchId=B.mchId(+)
      

  3.   

    update A set price = (select price from B where A.mchId=B.mchId)
    where A.mchId in (select B.mchId from B)