Heute schlug eine nette Query aus civicrm in #mysql.de auf
SELECT DISTINCT UPPER(LEFT(contact_a.sort_name, 1)) as sort_name[Mehr]
FROM civicrm_contact contact_a
LEFT JOIN civicrm_group_contact `civicrm_group_contact-101`
ON contact_a.id = `civicrm_group_contact-101`.contact_id
LEFT JOIN civicrm_group_contact `civicrm_group_contact-102`
ON contact_a.id = `civicrm_group_contact-102`.contact_id
LEFT JOIN civicrm_group_contact `civicrm_group_contact-46`
ON contact_a.id = `civicrm_group_contact-46`.contact_id
LEFT JOIN civicrm_group_contact `civicrm_group_contact-60`
ON contact_a.id = `civicrm_group_contact-60`.contact_id
LEFT JOIN civicrm_group_contact `civicrm_group_contact-6`
ON contact_a.id = `civicrm_group_contact-6`.contact_id
LEFT JOIN civicrm_group_contact `civicrm_group_contact-94` …