Employee_table
Id | FirstName | LastName | Division |
---|---|---|---|
1 | John | Smith | A |
2 | Emily | Jones | B |
3 | John | Smith | B |
4 | John | Snow | A |
5 | John | Smith | C |
I want to move all duplicate names from Employee_table to a table named Dupes. Dupes has the all the same columns as Employee_table (assume both tables have more columns after Division).
In the table above, there are 3 dupes of John Smith, so all three need to be moved to Dupes (within a Transaction). How do I achieve that?
EDIT: Can we keep the query as simple as possible? I am new to SQL (this is not homework).