Check out example codes for "how to delete all duplicate items in mysql". It will help you in understanding the concepts better.

Code Example 1

DELETE FROM FriendsData WHERE fID 
       NOT IN ( SELECT fID FROM FriendsData 
                   GROUP BY UserID, FriendsUserID, IsSpecial, CreatedBy)

Learn ReactJs, React Native from akashmittal.com