Mysql Query Duplicate row

Mysql Query Duplicate row

Sample 1

SELECT t1.*,COUNT(t1.col1) AS countDup FROM table1 t1
LEFT JOIN table1 t2
ON t1.col1=t2.col1
GROUP BY t1.col1 HAVING COUNT(t1.col1) >= '2'

Or Use HAVING Sample 2

SELECT id, COUNT(id) AS id
FROM table
GROUP BY id
HAVING (COUNT(id) >= '2')