我现在有个a表里的hs_code数据为空
我现在有个b表里面有一列数据hs_code1
我现在想把b表里的hs_code1数据更新到表里的hs_code列上

解决方案 »

  1.   

    有唯一主键的话 ..
    update A a 
       set a.hs_code = (select b.hs_code1 from B b where a.id = b.id);
      

  2.   

    我现在有个a表里的hs_code数据为空
    我现在有个b表里面有一列数据hs_code1
    我现在想把b表里的hs_code1数据更新到表里的hs_code列上
    总得有可以相关联的条件啊,不然怎么更新。
    update a set a.hs_code=b.hs_code1 from tableA a,tableB b
    where 条件