crm_contacts (contact_id, email, country, full_name) is typed in by hand, by several teams. The rule is one contact per person per country, and the natural key is:
- •the email lower-cased, with surrounding spaces removed, and
- •the country code upper-cased, with surrounding spaces removed.
The same email in two different countries is allowed. A contact with no email (NULL, empty or only spaces) has no key and is left out of the check.
Find every natural key that more than one contact shares.
Columns: email_key, country_key (the normalised values), row_count, contact_ids (the contacts' ids in ascending order, joined with , and no spaces, e.g. '4,12'). Sort by email_key, then country_key.