How to delete duplicate entries from MySQL keeping only latest entry
20 July 2017

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