update tabla1 set total1=valor1+valor2+valor3+ (select sum(valor2) from tabla2 where tabla2.nrot1=CODIGO ) where tabla1.nrot1=CODIGO