I need to transfer data from one table to another. The second table received the primary key constraint (and the first has no constraints). They have the same structure. I want to select all rows from table A and insert it into table B without a duplicated row (if row is0 is duplicated, I only want to take the first one found)
Example:
MyField1 (PK) | MyField2 (PK) | MyField3(PK) | MyField4 | MyField5
----------
1 | 'Test' | 'A1' | 'Data1' | 'Data1'
2 | 'Test1' | 'A2' | 'Data2' | 'Data2'
2 | 'Test1' | 'A2' | 'Data3' | 'Data3'
4 | 'Test2' | 'A3' | 'Data4' | 'Data4'
As you can see, the second and third lines received the same pk key, but different data in MyField4 and MyField5. So, in this example, I would like to have the first, second, and fourth lines. Not the third, because it is a duplication of the second (even if MyField4 and MyField5 contain different data).
How can I do this with one choice?
THX