Had a case recently where I had to merge data from two identically structured tables containing nearly identical data.
"Nearly identical" meaning most table data is identical in both; sometimes a row is missing from one of the tables; sometimes same row (according to PK) appears in both, but some columns are NULL is one tables (while others can be NULL in the second).
Otherwise no contradicting data: it was not possible for some data to be "3" in one table and "4" in the other.
How do you create a merge of the tables, such that all missing rows are completed, and NULLs replaced by actual values when possible?
pt-table-sync comes to mind: one can do a bidirectional syncing of two tables, and actually stating how to resolve ambiguities (like "greater value[Read more...]