I think I’ve finally reached the point where googling is no longer efficient in my php/mysql education. So, this is my first question on stack overflow. I’m hoping I don’t screw this up.
I’m importing a table from a 3rd party twice daily. I want to import the table into an existing table. Between updates, both tables will be changed. The imported table will have a different number of rows, but the existing table will have values in the rows changed.
I only want to add the rows that weren’t already present in the existing table, but I don’t want to use mysql’s REPLACE due to the changed values of the existing table.
Any ideas on how to go about doing this?
You might be lucky using
INSERT IGNORE.This would insert all new primary key values from table2 into table1. If the key already exists in table1 it will supersede the one in table2 and thus will it not be inserted/replaced.