Replace value in cell from table A with values from table B, if id matches
You can join the tables in the UPDATE
statement:
UPDATE table_b b
SET value = a.value
FROM table_a a
WHERE a.id = b.id AND b.value IS NULL;
You can join the tables in the UPDATE
statement:
UPDATE table_b b
SET value = a.value
FROM table_a a
WHERE a.id = b.id AND b.value IS NULL;