Skip to content

Instantly share code, notes, and snippets.

@amitmerchant1990
Created May 31, 2017 07:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amitmerchant1990/d570d98715508f412753253fbced8e24 to your computer and use it in GitHub Desktop.
Save amitmerchant1990/d570d98715508f412753253fbced8e24 to your computer and use it in GitHub Desktop.
Quickly find duplicate records based on any field
SELECT *
FROM 2009_product_catalog
WHERE sku IN (
SELECT sku
FROM 2009_product_catalog
GROUP BY sku
HAVING count(sku) > 1
)
ORDER BY sku
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment