Posted By

wirenaught on 04/23/11


Tagged


Versions (?)

duplicate record finder that itemizes results (vs. count summary)


 / Published in: MySQL
 

URL: http://stackoverflow.com/questions/854128/find-duplicate-records-in-mysql

  1. #The Problem:
  2.  
  3. #You want an itemized listing like:
  4. #JIM JONES 100 MAIN ST
  5. #JOHN SMITH 100 MAIN ST
  6.  
  7. #Instead of the usual count summary like:
  8. #100 MAIN ST 2
  9.  
  10. #The Solution:
  11. SELECT firstname, lastname, list.address FROM list
  12. INNER JOIN (SELECT address FROM list
  13. GROUP BY address HAVING count(id) > 1) dup ON list.address = dup.address

Report this snippet  

You need to login to post a comment.