SQL update fields of one table from fields of another one.

Posted by Nir on Stack Overflow See other posts from Stack Overflow or by Nir
Published on 2010-05-04T08:27:14Z Indexed on 2010/05/04 8:38 UTC
Read the original article Hit count: 258

Filed under:
|
|

I'm having two tables:
A [ID, column1, column2, column3]
B [ID, column1, column2, column3, column4]

A table will always be subset of B table (meaning all columns of A are also in B).

I want to update a record with a specific ID in B with their data from A for all columns of A. This ID exists both in A and B.

Is there an UPDATE syntax or any other way to do that without specifying the column names, just saying "set all columns of A"?

I'm using postgresql, so a specific non-standard command is also accepted (however, not preferred).

Thanks.

© Stack Overflow or respective owner

Related posts about sql

Related posts about update