I have been trying to write a query that will find duplicates in my database and display 2 fields from 2 different tables. Here's what I have been using and it works, just not the way I would like it too.
SELECT id, name, number COUNT(number)
FROM owners
GROUP BY name
HAVING COUNTY(number) > '1'
The query works and does display the number of times the name appears in the table. However, I want to see the name listed however many times it is duplicated. I really don't want to see the name and how many times it's found, just show the name and show the duplicates, such as:
NAME 001 - 12345
NAME 001 - 54321
NAME002 - 22331
NAME002 - 32152
NAME002 - 113322
etc.
Any ideas on how I could "tweak" my query to work for me!
Thanks in advance!