1
I would like to ask for help with an update on Posrgresql
I need to update the value of a column in a table, but that goes through conditions of 2 tables. I tried the code:
update proced_conv set proced_conv.vl_unitario = (proced_conv.vl_unitario_bras * c.ajuste_porcent / proced_conv.fator_ajuste)
from proced_conv
inner join convenio c on c.cd_convenio = proced_conv.cd_convenio
inner join proced_conv_det pcd on pcd.cd_proced_conv = proced_conv.cd_proced_conv
where convenio.cd_convenio in (94, 146) and pcd.cd_proced = 28021609
However the following error appears:
ERROR: table name "proced_conv" specified more than Once SQL state: 4271
2
Thank you very much!
– Victor Peixoto