function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MrdiniMrdini 

A simple SOQL comparision?

Hi, Due to a recent discussion at my company, I was idly curious in finding out how many duplicates we have in our system. However, due to the fact that as far as I can tell, Leads & Contacts aren't related (in the "right way"), so there is no way to run the below query...
SELECT Contact.id FROM Contact WHERE Contact.Email = Lead.Email
I notice that Contact IS related to Lead by "ConvertedContactID", but that's not what I'm after. Thoughts? I'm not keen on writing a PHP script to retrieve thousands of records & compare them... TIA!
DevAngelDevAngel
Right, I think I would look at a tool like the Excel connector.  You can download the leads and contacts, pivot them on the appropriate fields, and cross reference from there.
MrdiniMrdini

DevAngel wrote:
Right, I think I would look at a tool like the Excel connector.  You can download the leads and contacts, pivot them on the appropriate fields, and cross reference from there.



Hmmm... I use a Mac so that's pretty much out of the question! :P

Since I guess there's no obvious way of doing this in SOQL, I guess I'll just wait till I get a chance to sort out the duplicates properly using a PHP script. (or APEX, if we're lucky!)

Shame - would've been nice if there was a simple SOQL one-liner that I could retrieve the size from.

Ah well, that's life!

Ta anyway