Quero atualizar dos campos da tabela tributacao_icms utilizando os valores dos campos da tabela tributacoes.
Nome de Tabela: tributacoes
Campos(A,B, C,D,E,F,G,H, I, J) da tabela tributacoes com valores:
A B C D E F G H I J
4 1 10 0,0000 0,0000 0,0000 0,0000 0,0000 0,0000 N
2 1 10 12,0000 17,0000 26,5700 26,5700 35,0000 35,0000 N
3 1 10 7,0000 17,0000 26,5700 26,5700 35,0000 35,0000 N
4 1 10 0,0000 0,0000 0,0000 0,0000 0,0000 0,0000 N
1 1 10 17,0000 17,0000 26,5700 26,5700 35,0000 35,0000 S
2 1 10 12,0000 17,0000 26,5700 26,5700 35,0000 35,0000 N
1 1 10 17,0000 17,0000 26,5700 26,5700 35,0000 35,0000 S
3 1 10 7,0000 17,0000 26,5700 26,5700 35,0000 35,0000 N
Nome de Tabela: tributacao_icms
Campos(AB,CD,EF,GH,IJ,LM,NO,porque) da tabela tributacoes com valores:
AB CD EF GH IJ LM NO porque
1 10 0,0000 0,0000 0,0000 0,0000 0,0000 N
1 10 0,0000 0,0000 0,0000 0,0000 0,0000 N
2 10 0,0000 0,0000 0,0000 0,0000 0,0000 N
2 10 0,0000 0,0000 0,0000 0,0000 0,0000 N
3 10 0,0000 0,0000 0,0000 0,0000 0,0000 N
3 10 0,0000 0,0000 0,0000 0,0000 0,0000 N
4 10 0,0000 0,0000 0,0000 0,0000 0,0000 N
4 10 0,0000 0,0000 0,0000 0,0000 0,0000 N
Já tentei fazer utilizando o comando update, mas não deu certo!
update tributacao_icms tn
set tn.AB =
(select t.A
from tributacoes t
where t.C = tn.CD
and t.C = '10');
Utilizo o PL/SQL Developer como ferramenta de SGBD.
Se algum puder me ajudar, agradeço desde já!