← Back to Gists

Find Duplicate Rows

📝 SQL
psilva774
psilva774 · 22d ago
This SQL snippet identifies rows that appear more than once in a table by grouping columns and filtering with a HAVING clause count greater than one.
SQL
SELECT column1, column2, column3, COUNT() AS duplicatecount
FROM yourtable
GROUP BY column1, column2, column3
HAVING COUNT() > 1;

Comments

-1
marc61294 marc61294 16d ago
@zmunoz368 that SQL pattern is a classic for finding dupliduplianItotally agree it's one of the most reliable approaches. Nothing beats a solid HAVING clause for clean data checks.