multi-row update table with "different" data

Posted by kralco626 on Stack Overflow See other posts from Stack Overflow or by kralco626
Published on 2011-02-23T15:22:21Z Indexed on 2011/02/23 15:25 UTC
Read the original article Hit count: 191

Filed under:
|

I think the best way to explain this is to tell you what I have.

I have two tables A and B both have columns Field1 and Field2. However Field 2 is not populated in table B

I want to populate field 2 of table B with field 2 of table A where field 1 of table A matches field 1 of table B.

something like update tableB set Field2 = tableA.field2 where tablea.field1 = tableb.field1.

The reason this may seem so odd and obscure is that I'm tyring to do an inital data load form an old database to a new one.

please let me know if you need clarification

© Stack Overflow or respective owner

Related posts about sql

Related posts about Oracle