Is there a way to find duplicate emails in Query?

We want to know if there are duplicate primary emails.  Can we query that data?
1. Create an Ad-Hoc query choosing Constituents
2. Under Browse for fields in: click Email Addresses
3. Now under Select Email Addresses fields: choose Primary Email address, click the blue arrow to insert that into "Include records where" area choosing equal to Yes.
a. Include Records where, 
  "Email Addresses\Primary email address is equal to Yes"

3. Under Results Fields to display: 
   a. Name
   b. COUNT(Lookup ID)
   c. Lookup ID

This can also be achieved in SQL if you would like to perform the query there.  Below is the SQL script you can run to return the constituents with multiple primary email addresses.

select count (emailaddress.isprimary), constituent.lookupid,
from emailaddress
join constituent on = emailaddress.constituentid
where emailaddress.isprimary = '1'
group by constituent.lookupid,
having count (emailaddress.isprimary) > 1 


 Blackbaud CRM

Was this article helpful?