CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • A good way to deal with duplicate contacts (same person, different email)
Pages: [1]

Author Topic: A good way to deal with duplicate contacts (same person, different email)  (Read 1675 times)

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
A good way to deal with duplicate contacts (same person, different email)
October 21, 2009, 11:03:19 pm
I don't know about you but a couple times a week in our rather large CiviCRM database we run into a situation where someone has a duplicate contact record, and by this I mean the same person + same address, but with a different email address.

I was looking for an efficient way to track down names that are potential duplications, and came up with this query.

Code: [Select]
SELECT t.id,
       t.last_name,
       a.street_address,
   a.city
  FROM civicrm_contact t
  JOIN civicrm_address a ON a.contact_id = t.id
  JOIN (SELECT n.last_name
          FROM civicrm_contact n
      GROUP BY n.last_name
        HAVING COUNT(*) > 1) nn ON nn.last_name = t.last_name;

You can visually scan the result, looking for last names with identical streets and cities, and then investigate to see if it is a duplicate contact.

Anyone found a better way to handle this?  Suggestions, improvements?
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: A good way to deal with duplicate contacts (same person, different email)
October 21, 2009, 11:20:17 pm
Wondering why you wouldn't create a Fuzzy duplicate matching rule with those criteria (match on name and address, or city or ...) and run it periodically?
Protect your investment in CiviCRM by  becoming a Member!

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: A good way to deal with duplicate contacts (same person, different email)
October 21, 2009, 11:30:35 pm
there is also the issue of how we handle same person - two emails - two drupal accounts. Stoob are you trying to deal with that too?

Apologies if this seems to be hijacking - totally ignore above if you aren't being rattled by issue of one person - two drupal accounts - two civicrm records (or any variations such as one person, one drupal account, two civicrm records)

Just spotted there is a Drupal 'user merge' project just coming out of the shadows - http://drupal.org/project/usermerge
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: A good way to deal with duplicate contacts (same person, different email)
October 21, 2009, 11:51:20 pm
Dave, thanks for bringing this to my attention.  I had no idea this existed http://wiki.civicrm.org/confluence/display/CRMDOC/Find+and+Merge+Duplicate+Contacts until now.  Yay!

Peter, only a small fraction of our CiviCRM contacts have Drupal accounts in this particular use case, so no I'm not running into this issue yet.

Thanks both.
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • A good way to deal with duplicate contacts (same person, different email)

This forum was archived on 2017-11-26.