I need to merge 2 tables with the same structure, table1
and table2
. They have mostly different rows, but some rows are duplicates.
Is there a way to merge table2
into table1
but leave out the duplicate records in 1 statement?
I'm quite new to MySQL to any help would be greatly appreciated.
EDIT: The query I have so far is just this:
INSERT INTO table1
SELECT *
FROM table2
So I don't know how to selectively leave out the duplicates.