Skip to content

Find Repeated Values in a Column

Group by a column and return each value that appears more than once, together with how many times it is duplicated.

Language: SQL

Added on: 19th August 2026

SELECT column_name, COUNT(*) AS duplicates
FROM table_name
GROUP BY column_name
HAVING COUNT(*) > 1;

Caveats

Replace table_name and column_name. COUNT(*) includes NULL groups on engines that group NULLs together; COUNT(column_name) ignores NULLs.