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, constituent.name
from emailaddress
join constituent on constituent.id = emailaddress.constituentid
where emailaddress.isprimary = '1'
group by constituent.lookupid, constituent.name
having count (emailaddress.isprimary) > 1 

Environment

 Blackbaud CRM
 4.0

Was this article helpful?


Thanks for your feedback! Did this solve your issue?

Comments (optional):


Thanks for your feedback!
We're glad it was helpful but sorry it didn’t solve your issue. If you need assistance, click Chat with Support below.
We’re sorry to hear that. Please tell us why.

 I don't like how this works.

 The answer is confusing.

 The answer didn't match what I was searching for.

Additional Comments (optional):


Thanks for your feedback! If you need assistance, click Chat with Support below.
Thanks for your feedback. Help us make our products even better by sharing details in our Idea Banks or our online Community.
Thanks for letting us know. We'll work on clarifying the information in the article. If you need assistance, click Chat with Support below.
Thanks for letting us know. We'll work on updating the search engine to return more relevant results.