Comparing 2 mysql tables and updating only records that have changed

Posted by Roland on Stack Overflow See other posts from Stack Overflow or by Roland
Published on 2010-03-23T12:36:57Z Indexed on 2010/03/23 12:43 UTC
Read the original article Hit count: 312

Filed under:
|

I have the following. Two mysql tables. I want to copy info that has changed from table a to b.

For example if row 1 column 2 has changed in table a I want to only update that column in table b. Table b is not the same as a but has same columns that also exist in a. The other solution I have is to just clear table b and replace it with the contents from table a, the problem with this could be that the script will take longer to execute, since there are more than 10000 records. Any advise for which method would work the best will be highly appreciated

© Stack Overflow or respective owner

Related posts about mysql

Related posts about php