how to update a column in psql with values from other table code example
Example 1: inner join update
UPDATE
t1
SET
t1.c1 = t2.c2,
t1.c2 = expression,
...
FROM
t1
[INNER | LEFT] JOIN t2 ON join_predicate
WHERE
where_predicate;
Example 2: sql update with field from another table
UPDATE table1
SET price=(SELECT price FROM table2 WHERE table1.id=table2.id);