Check out example codes for "mysql delete older duplicates". It will help you in understanding the concepts better.

Code Example 1

delete test
   from test
  inner join (
     select max(id) as lastId, email
       from test
      group by email
     having count(*) > 1) duplic on duplic.email = test.email
  where test.id < duplic.lastId;

Learn ReactJs, React Native from akashmittal.com