• jhurff
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

Hi All...

 

Please excuse me as I am new to the SF developer community.

 

I am looking for a method to programatically identify potential duplicate contact records within the SF database.  We are going through a cleansing activity against our SF database and I'd like to be able to run an ad hoc query to identify duplicates.  In general, I am looking for the ability to run GROUP BY queries against the database.  I don't see this as a capability within the SOQL documentation.  Is there a way to issue a statement something like the following...

 

select q1.FIRSTNAME, q1.LASTNAME
from CONTACTS q1
where 1 < (select count(*)
from CONTACTS q2
where q1.FIRSTNAME = q2.FIRSTNAME AND q1.LASTNAME = q2.LASTNAME)

 

 Or something similar?  I basically need to identify contacts with the same first and lastname to identify if they are really dupes.

 

Any suggestions would be greatly appreciated.

  • December 16, 2009
  • Like
  • 0