Note to self
This is how you delete duplicate entries from MySQL keeping only latest entry -
DELETE FROM test WHERE id NOT IN ( SELECT a.max_id FROM ( SELECT MAX(id) as max_id FROM test GROUP BY email ) a )
source 1 source 2