I have a big SQL database with these tables for example:
first_name | last_name | email | country | created_at
-----------------------------------------------------------------
john | DOE | johndoe@email.com | USA | 2016-05-01
john | DOE | johndoe@email.com | FRANCE | 2019-05-03
doe | John | johndoe@email.com | CANADA | 2011-08-23
The previous database was built without a unique email (yes it's horrible). So, I need to merge the user with same email but different data with the most recent record.
Then update the database by deleting the older one and keep the latest one.
Excuse me if it's not clear..