Performing UPDATE in ORACLE using FROM

1

How to UPDATE in Oracle records without using a IN clause to change bulk data?

This way:

UPDATE TABELA1 SET DADO = DADO
  FROM TABELA2 
 WHERE TABELA1.CODIGO = TABELA2.CODIGO;

Currently it forces me to report a IN clause:

UPDATE TABELA1 SET DADO = DADO
 WHERE CODIGO IN (SELECT CODIGO FROM TABELA2);
    
asked by anonymous 12.01.2018 / 21:15

1 answer

1

The FROM clause is not accepted in the UPDATE command, hence the use of the IN clause in the WHERE. Apparently, it is accepted on some Database Management Systems such as Postgre. But if we look at the ANSI standard, it will not be present. I did this check in "ANSI SQL 99 Part 2 - SQL Foundation".

    
14.01.2018 / 15:43