How can I pass this query
to Oracle
?, I'm updating a field from table A through inner join
table B:
UPDATE ATA
SET A.ID_IN = B.id_in
FROM TMP_TRF_ALL ATA
INNER JOIN items B
on ATA.seq=B.seq
WHERE ATA.PROCESADO = 1
AND ATA.EXT = '213'
AND B.ID_COMPANY='1'
I have done this, but it is not correct because it does not update and it is as if I wanted to update the field ID_IN
of the table items
, when in fact I want to update the field ID_IN
of the tableTMP_TRF_ALL
UPDATE
(SELECT ATA.id_in as T1IV,B.id_in AS T2IV FROM TMP_TRF_ALL ATA INNER JOIN items B
on ATA.seq=B.seq
WHERE ATA.PROCESADO = 1 AND ATA.EXT = '213' AND B.ID_COMPANY='1')T
SET T.T1IV=T.T2IV
You can use a statement
merge
to achieve the goal. In your case, it would be something like: