0

What SOSQL query can list Lead Names where the Name and Company have a duplicate. (to de-dupe Leads for the same person in the same company).

This query won't execute as Count doesn't seem to support fields as well:

SELECT name, company, COUNT() FROM lead GROUP BY name, company HAVING COUNT() > 1

2
  • you want COUNT(Id)
    – cropredy
    Commented Sep 25, 2019 at 22:48
  • Oh right. Thanks!
    – JB Cooney
    Commented Sep 26, 2019 at 17:38

2 Answers 2

1

You should be using:

SELECT Name, Company, COUNT(Id) FROM Lead GROUP BY Name, Company HAVING COUNT(Id) > 1
2
  • Thank You. I added (Id) and it works.
    – JB Cooney
    Commented Sep 27, 2019 at 22:34
  • Please mark the answer as accepted so as to benefit the Community. I'm glad the solution was simple.
    – cropredy
    Commented Sep 27, 2019 at 22:54
0

If you use duplicate rules you could build a standard report with the Duplicate Record Set Object.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .