Answers for "delete dups mysql"

SQL
3

mysql remove duplicates

DELETE FROM table_name WHERE id 
       NOT IN ( SELECT id FROM table_name 
                   GROUP BY field_1, field_2)
Posted by: Guest on June-18-2020
4

mysql delete duplicates

DELETE FROM CONTACTS
WHERE ID NOT IN
      (SELECT *
       FROM (SELECT max(ID)		
             FROM CONTACTS
             GROUP BY EMAIL) t);
 -- ⇓ Test it ⇓ (Fiddle source link)
Posted by: Guest on July-13-2021
2

how to delete all duplicate items in mysql

DELETE FROM FriendsData WHERE fID 
       NOT IN ( SELECT fID FROM FriendsData 
                   GROUP BY UserID, FriendsUserID, IsSpecial, CreatedBy)
Posted by: Guest on April-17-2020

Code answers related to "SQL"

Browse Popular Code Answers by Language