Answers.Body: <p>Here's a hack that only works if you're not using the "Do not SMS" field for contacts, if you do, find a different one.</p>
  
  <ol>
  <li><p>Use that field as a temporary flag to identify contacts in the group, using sql like this:</p>
  
  <p>UPDATE civicrm_contact set do_not_sms = 1 where id in (SELECT contact_id FROM civicrm_email group by contact_id having count(id) > 1)</p></li>
  <li><p>Use that field via a search to select all the multi-email contacts.</p></li>
  <li><p>Put 'em in a group.</p></li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-08T18:42:34.567Z
Answers.LastActivityDate: 2017-08-08T18:42:34.567Z
Answers.UserDisplayName: Alan Dixon
Answers.Body: <p>This is an old question but has a new solution using Search Kit:</p>
  <p>See <a href="https://dmaster.demo.civicrm.org/civicrm/admin/search#/create/Contact?params=%7B%22version%22:4,%22select%22:%5B%22id%22,%22display_name%22,%22COUNT(Contact_Email_contact_id_01.email)%20AS%20COUNT_Contact_Email_contact_id_01_email%22%5D,%22orderBy%22:%7B%7D,%22where%22:%5B%5D,%22groupBy%22:%5B%22id%22%5D,%22join%22:%5B%5B%22Email%20AS%20Contact_Email_contact_id_01%22,%22INNER%22,%5B%22id%22,%22%3D%22,%22Contact_Email_contact_id_01.contact_id%22%5D%5D%5D,%22having%22:%5B%5B%22COUNT_Contact_Email_contact_id_01_email%22,%22%3E%3D%22,%222%22%5D%5D%7D" rel="nofollow noreferrer">here</a></p>
  <p><a href="https://i.sstatic.net/Ja0Ij.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Ja0Ij.png" alt="enter image description here" /></a></p>
  <p>From the search, you could create a smart group.</p>
  <p>The original solution looks for multiple addresses even if they are the same.  To get the same results, untick 'distinct'.  For the purpose described in the question, it is probably more useful to look at the number of distinct addresses.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-30T16:58:57.897Z
Answers.LastActivityDate: 2022-05-30T16:58:57.897Z
Answers.UserDisplayName: Aidan
Body: <p>I'd like to create such a group so that I can contact them to identify which of their multiple email addresses they want to have as their primary one.</p>
  
Tags: <civimail><email><searchkit>
Title: How can I create a group containing all contacts with more than one email address?
ThreadText: # How can I create a group containing all contacts with more than one email address?
  
  (Asked by: username_0 on 2017-08-08)
  
  I'd like to create such a group so that I can contact them to identify which of their multiple email addresses they want to have as their primary one.
  
  **Tags:** civimail, email, searchkit
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2022-05-30. Score: 4 | Accepted answer
  
  This is an old question but has a new solution using Search Kit:
  
  See [here](https://dmaster.demo.civicrm.org/civicrm/admin/search#/create/Contact?params=%7B%22version%22:4,%22select%22:%5B%22id%22,%22display_name%22,%22COUNT(Contact_Email_contact_id_01.email)%20AS%20COUNT_Contact_Email_contact_id_01_email%22%5D,%22orderBy%22:%7B%7D,%22where%22:%5B%5D,%22groupBy%22:%5B%22id%22%5D,%22join%22:%5B%5B%22Email%20AS%20Contact_Email_contact_id_01%22,%22INNER%22,%5B%22id%22,%22%3D%22,%22Contact_Email_contact_id_01.contact_id%22%5D%5D%5D,%22having%22:%5B%5B%22COUNT_Contact_Email_contact_id_01_email%22,%22%3E%3D%22,%222%22%5D%5D%7D)
  
  [![enter image description here](https://i.sstatic.net/Ja0Ij.png)](https://i.sstatic.net/Ja0Ij.png)
  
  From the search, you could create a smart group.
  
  The original solution looks for multiple addresses even if they are the same. To get the same results, untick 'distinct'. For the purpose described in the question, it is probably more useful to look at the number of distinct addresses.
  
  
  ---
  
  ### Answer by username_0 on 2017-08-08. Score: 3
  
  Here's a hack that only works if you're not using the "Do not SMS" field for contacts, if you do, find a different one.
  
  1. Use that field as a temporary flag to identify contacts in the group, using sql like this:
  
     UPDATE civicrm\_contact set do\_not\_sms = 1 where id in (SELECT contact\_id FROM civicrm\_email group by contact\_id having count(id) > 1)
  2. Use that field via a search to select all the multi-email contacts.
  3. Put 'em in a group.
  
  
  ---
  
  