fevereiro 10, 2012 às 2:56 pm
#102745
Participante
Tenta assim:
update tabelaA a
set a.quant = (
select b.quant
from tabelaB b
where a.acod = b.bcod
and a.afilial = b.bfilial
and a.aquant != b.bquant
)
where exists (
select 1
from tabelaB b
where a.acod = b.bcod
and a.afilial = b.bfilial
and a.aquant != b.bquant
)
Obs.: Estou chutando que cod e filial são chaves nas duas tabelas…