I have two tables, TABLESource is where will i get the records to be inserted in TABLEDest,
now TABLESource can contain duplicate fields:
id code name
2 09 abc
3 10 uu
2 09 def
3 10 rr
2 09 gh
and i have to insert first all the unique records in the TABLEDest, the id+code is primary key (unique)
id code name
2 09 abc
3 10 uu
now, in the end, if the TABLESource found duplicate id and name, it must update the TABLEDest with the latest records found in the TABLESource with the same primary key (id_name)
id code name
2 09 gh
3 10 rr
I have no clue how to do that. Please help me. THanks 🙂
I would suggest iterating through your source table and for each row in the source:
This is psudo code, so directly copying and pasting won’t work, but it should be enough for you to use your favorite flavor of language to make it happen.