Quantcast
Channel: How to do an update + join in PostgreSQL? - Stack Overflow
Viewing all articles
Browse latest Browse all 19

Answer by madhuri Buddhadev for How to do an update + join in PostgreSQL?

$
0
0

--goal: update selected columns with join (postgres)--

UPDATE table1 t1      SET    column1 = 'data'FROM   table1           RIGHT JOIN table2                  ON table2.id = table1.id   WHERE  t1.id IN     (SELECT table2.id   FROM   table2   WHERE  table2.column2 = 12345) 

Viewing all articles
Browse latest Browse all 19

Trending Articles