I have 2 tables. one from yesterday (300k rows) and another one from today with the same count of rows but the data changes in some columns.
Those two tables have around 120 columns.
How can i update only the changes.
I have tried using delete :
delete from tableA
where id in (select id from tableB)
But it too slow.
Also tried
update tableA inner join tableB
on tableA.id=TableB.id
And it didn't worked.
You have to set the values in your update query to get the changes.
Example:
update tableA inner join tableB on tableA.id=TableB.id
set tableA.col1=TableB.col1,
tableA.col2=TableB.col2,
tableA.col3=TableB.col3;
and also you can add more conditions in where
clause to make query run on filtered records.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With