oracle update table from code example
Example 1: update table from another table oracle
UPDATE t1
SET t1.COL1 = t2.COL1, t1.COL2 = t2.COL2
FROM my_table AS t1
INNER JOIN my_other_table AS t2 ON t1.COLID = t2.ID
WHERE t1.COL3 = 'OK';
Example 2: oracle update with
UPDATE mytable t -- Update using WITH statement
SET value3 = (
WITH comp AS (
SELECT id, value1
FROM mytable t
WHERE value2 > 10
)
SELECT c.value1
FROM comp c
WHERE c.id = t.id
);