Finding IDs of duplicate records sql code example
Example 1: finding duplicate column values in table with sql
SELECT username, email, COUNT(*)
FROM users
GROUP BY username, email
HAVING COUNT(*) > 1
Example 2: get count of duplicate records
SELECT
col,
COUNT(col)
FROM
table_name
GROUP BY col
HAVING COUNT(col) > 1;