I want to pull out duplicate records in a MySQL Database. This can be done with:
SELECT firstname, lastname, list.address FROM list INNER JOIN (SELECT address FROM list GROUP BY address HAVING COUNT(id) > 1) dup ON list.address = dup.address;
Which results in:
JIM JONES 100 MAIN ST
JOHN SMITH 100 MAIN ST
I would like to pull it so that it shows each row that is a duplicate. Something like:
JIM JONES 100 MAIN ST
if the result is :
JIM JONES 100 MAIN ST
JOHN SMITH 100 MAIN ST
JOHN SMITH 100 MAIN ST
I would like to pull it so that it shows each row that is a duplicate. Something like:
JOHN SMITH 100 MAIN ST
JOHN SMITH 100 MAIN ST
I want only duplicate data not original data