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

Code Example 1

DELETE FROM table_name WHERE id 
       NOT IN ( SELECT id FROM table_name 
                   GROUP BY field_1, field_2)

Code Example 2

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

Code Example 3

DELETE FROM table_name 
WHERE 
	id IN (
	SELECT 
		id 
	FROM (
		SELECT 
			id,
			ROW_NUMBER() OVER (
				PARTITION BY field_1
				ORDER BY field_1) AS row_num
		FROM 
			table_name
		
	) t
    WHERE row_num > 1
);

Learn ReactJs, React Native from akashmittal.com