I have a table called jobs in a MySQL database.
One user adds data by importing an Excel file into a linked table in Access.
This works fine, except occasionally, there is a row with a duplicate id.
What I would like to do when this happens is take the data from one column (comments) of the new row and insert it into the existing row with the identical id.
For example, the original table:
id customer product comments
1 Jeff Widget Hello
2 Fred Sprocket Important comment here
Some imported data:
id customer product comments
2 Fred A new and different comment
3 Jerry Widget More comments
The table after importing the above data:
id customer product comments
1 Jeff Widget Hello
2 Fred Sprocket A new and different comment
3 Jerry Widget More comments
I’m at a loss as to how to build a trigger that would achieve this goal.
Any advice?
EDIT: Opted to use a PHP script to clean up the duplicates after the fact. Thanks for the input, all.
From my experience with Access linked tables, this can only be done with code or a two-step query process. First inserting the new records, and then performing an update operation with the remainder of the data set (you could do it in the opposite order as well). Is this something you need to do on an ongoing basis, or just a one time deal?