Select em 3 tabelas e update em 1 delas

#105972
Avatar de PAULO HENRIQUEPAULO HENRIQUE
Participante

@Rman,

Igualei os campos de Serie de nota, e consegui trazer somente a nota em questão .
Exemplo:
…..
and C.Serie_Nota_Fiscal = A.Serie_Nota_Fiscal

Agora, como ficaria o update para esse caso.

update FAT_MOVIMENTO_ITEM A
set A.Base_Pis = 0
[b]????????
[/b]INNER JOIN fat_movimento_capa C on C.NUMERO_NOTA_FISCAL = A.Numero_Nota_Fiscal
WHERE A.ITEM_ESTOQUE = 31025
AND C.dta_entrada_saida between to_date(’12/08/2013′,’dd/mm/yyyy’) and to_date(’12/08/2013′,’dd/mm/yyyy’)
and C.status = ‘F’
and C.revenda = 1
and C.Tipo_Transacao = ‘P01’
and C.Serie_Nota_Fiscal = A.Serie_Nota_Fiscal

plugins premium WordPress