不知道你的b表的deviceno是否有唯一约束,如果有,则可以
update a set deviceno=(select newdeviceno from b where b.deviceno=a.deviceno);

解决方案 »

  1.   

    update a set deviceno=(select newdeviceno from b where a.deviceno=b.deviceno) where exists(select 1 from b where a.deviceno=b.deviceno)
      

  2.   

    update a set a.deviceno=(select b.deviceno from b where b.deviceno=a.deviceno)
      

  3.   

    如果a.deviceno上面有索引,如果可以的话,先去掉,update后再创建。
      

  4.   

    update a set a.deviceno=(select b.deviceno from b where b.deviceno=a.deviceno)
      

  5.   

    update a set a.deviceno=(select b.deviceno from b where b.deviceno=a.deviceno)