Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

mysql delete older duplicates

DELETE FROM CONTACTS
WHERE ID NOT IN
      (SELECT *
       FROM (SELECT max(ID)		
             FROM CONTACTS
             GROUP BY EMAIL) t);
 -- ⇓ Test it ⇓ (Fiddle source link)
Source by sqlfiddle.com #
 
PREVIOUS NEXT
Tagged: #mysql #delete #older #duplicates
ADD COMMENT
Topic
Name
1+5 =