Originally Posted by BubikolRamios
To hopefuly clarify to you some things.
to merge two tables with any chance of good result:
1. they have to have identical structure
2. merged table must have the same structure as the source ones
3.Imagine you have only one field in both source tables, and only one record and contence of it is in both 'john doe'
4. what do you expect in merged table ?
The second option would be choice for most people on this forum.
Hence the merged table has to have index !
In order that insert ignore command would work --> prevent duplictaes of 'john doe' in merged table.
And as you showed, there is no key/indexes in your source table. If you have a table with 1000 and one with 200, they should merge with no prob into 1200 records table.
Of course there will be a mess with id-s, ....
There, I told you same as old pedant, from another angle, hope it helps.
Hello my friend. Sorry for the delay, my daughter went to hospital, but everything is good now..
Look, the tables have identical structure, and in merged table i just want the id to be changed to a unique id, because it doesnt matter for me if the field name has 2 identical value, because it could be related to 2 different leads, i mean that i would like to have the row removed only if ALL FIELDS are identical, it does not matter if only one of them is identical, i want the duplicate to be remove only if all fields are identical, and i need a unique id per row.
when i am talking about removing duplicates, the issue is that i will have to run this merging query everyday and i will need to process only new items, new leads only, to have only 1 table with all leads.. so i expect it to be
john doe lead 1
john doe lead 2
but if ALL THE FIELDS are identical, then i expect to have only
did you understand my problem now? many thanks, really.