Here a query for finding duplicates in a table. Suppose you want to find all ‘Coupon Code’ in a table that exist more than once
SELECT Coupon_Code
FROM Coupon
GROUP BY Coupon_Code
HAVING ( COUNT(Coupon_Code) > 1 )
FROM Coupon
GROUP BY Coupon_Code
HAVING ( COUNT(Coupon_Code) > 1 )
Delete duplicate value from table
DELETE FROM Coupon
GROUP BY Coupon_Code
HAVING ( COUNT(Coupon_Code) > 1 )
GROUP BY Coupon_Code
HAVING ( COUNT(Coupon_Code) > 1 )