Categorized | database

Find and Delete Duplicates value from SQL table

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 )
Delete duplicate value from table
DELETE FROM Coupon
GROUP BY Coupon_Code
HAVING ( COUNT(Coupon_Code) > 1 )


Leave a Reply


rss_32 twitter_32 facebook_32 linkedin_32 stumbleupon_32 friendfeed_32 google_32

Information

  • Premium News Home
  • Designed by Adii
  • Log in
  • Powered by Wordpress
  • Entries RSS
  • Comments RSS
Facebook Like Button for Dummies