In Postgres Update query with From clause can be used to update by catching between two or more tables.
The thing to keep in mind is the use of aliases in a certain way. For eg. the below example works where the alias before set is missing i.e. the alias for the 1st table to be compared is missing.
update schema.table1 set col1=v.col1 from schema.table2 v where ...
...
and table1.col2=v.col2 and table1.col3=value and table1.state_cd=v.state_cd;
The thing to keep in mind is the use of aliases in a certain way. For eg. the below example works where the alias before set is missing i.e. the alias for the 1st table to be compared is missing.
update schema.table1 set col1=v.col1 from schema.table2 v where ...
...
and table1.col2=v.col2 and table1.col3=value and table1.state_cd=v.state_cd;