I am going to export a table, but the problem is there may be duplicate primary keys. I want to update those records.
I checked the community, and I found couple of articles. Basically the simple way is, I need to run a query to delete the records that have duplicate keys in the target table first.
In easy morph, there is a place for me to write a query that will be executed before I run the export step. How ever, how do I reference the existing table to get the duplicate records list?
For example, I need to import a table Table1 from spreadsheet and export to somewhere with exactly same structure. Id is the primary key. Step 1, I import a table from spread sheet. (This is the first confusion thing here, I don’t know the name of the table after imported!)
Step 2, export. I can write my query like so
Delete From TargetTable Where Id In (Select Distinct(Id) From (??? what is the name of my imported table???)); Then export to TargetTable now, so I don’t have any duplicated primary key any more.