Greenplum update with multiple tables

Recently ran into an issue using Greenplum to update a column. I had column1 in tableA that needed to be set to the value of column1 in tableB. Finally came across the correct syntax here. This is what I was looking for:


UPDATE tableA 
SET col1 = tableB.col1 
FROM tableB 
WHERE tableA.col2=tableB.col2;

Comments

Popular posts from this blog

Database, schema, and table sizes in Greenplum

Show running queries on Postgresql/Greenplum