Hi!
I have a database with the following tables:
- data
- datamodifications
- mergeddata
The "data" table is imported from a large excel file (about 5000 rows and 40 columns) and needs to be updated about once a year.
The idea is to use the "datamodifications" table to store all modifications and then merge "datamodifications" and "data" into "mergeddata", so when i have to update the "data" table next year i can just remerge it with my modifications.
My problem is that i can´t merge the two without getting dupliace entries. I have tried with this query but it gives me duplicate entries:
How can i remove the duplicate entries (or is there a better way than actually writing SQL to do what i want do to?
(Sorry for the poor english, it is not my mother tounge).
I have a database with the following tables:
- data
- datamodifications
- mergeddata
The "data" table is imported from a large excel file (about 5000 rows and 40 columns) and needs to be updated about once a year.
The idea is to use the "datamodifications" table to store all modifications and then merge "datamodifications" and "data" into "mergeddata", so when i have to update the "data" table next year i can just remerge it with my modifications.
My problem is that i can´t merge the two without getting dupliace entries. I have tried with this query but it gives me duplicate entries:
Code:
SELECT col1, col2, col3
FROM data
UNION
SELECT col1, col2, col3
FROM datamodifications
ORDER BY col1;
(Sorry for the poor english, it is not my mother tounge).