SELECT 
obj_main.isys_obj__id AS '__id__', 
j2.isys_cats_person_group_list__title AS 'LC__CONTACT__GROUP_TITLE###1_53', 
j2.isys_cats_person_group_list__ldap_group AS 'LC__CMDB__CATS__PERSON_GROUPS__LDAP_MAPPING###1_53', 
j10.isys_cmdb_status__title AS 'LC__UNIVERSAL__CMDB_STATUS#LC__CONTACT__TREE__MEMBERS###catg_1', 
j16.isys_cats_person_list__custom1 AS 'Custom Display name#LC__CONTACT__TREE__MEMBERS###cats_49', 
j16.isys_cats_person_list__first_name AS 'LC__CONTACT__PERSON_FIRST_NAME#LC__CONTACT__TREE__MEMBERS###cats_49', 
j16.isys_cats_person_list__last_name AS 'LC__CONTACT__PERSON_LAST_NAME#LC__CONTACT__TREE__MEMBERS###cats_49', 
j16.isys_cats_person_list__title AS 'LC__CMDB__LOGBOOK__TITLE#LC__CONTACT__TREE__MEMBERS###cats_49', 
j17.isys_catg_custom_fields_list__field_content AS 'locales::fmt_date::Eintrittsdatum#LC__CONTACT__TREE__MEMBERS###catg_custom_22', 
j18.isys_catg_custom_fields_list__field_content AS 'locales::fmt_date::Austrittsdatum#LC__CONTACT__TREE__MEMBERS###catg_custom_22', 
job15.isys_obj__title AS 'LC__UNIVERSAL__TITLE#LC__CONTACT__PERSON_ASSIGNED_ORGANISATION#LC__CONTACT__TREE__MEMBERS###catg_1' 

 FROM isys_obj AS obj_main 
INNER JOIN isys_cmdb_status AS obj_main_status ON obj_main_status.isys_cmdb_status__id = obj_main.isys_obj__isys_cmdb_status__id 
LEFT JOIN isys_cats_person_group_list AS j2 ON j2.isys_cats_person_group_list__isys_obj__id = obj_main.isys_obj__id  
LEFT JOIN isys_person_2_group AS j4 ON obj_main.isys_obj__id = j4.isys_person_2_group__isys_obj__id__group 
LEFT JOIN isys_cats_person_list AS j6 ON j4.isys_person_2_group__isys_obj__id__person = j6.isys_cats_person_list__isys_obj__id AND j6.isys_cats_person_list__status IN (2)  
LEFT JOIN isys_obj AS j9 ON j9.isys_obj__id = j6.isys_cats_person_list__isys_obj__id 
LEFT JOIN isys_obj AS j12 ON j12.isys_obj__id = j6.isys_cats_person_list__isys_obj__id  
LEFT JOIN isys_cmdb_status AS j10 ON j10.isys_cmdb_status__id = j12.isys_obj__isys_cmdb_status__id 
LEFT JOIN isys_cats_person_list AS j16 ON j16.isys_cats_person_list__isys_obj__id = j6.isys_cats_person_list__isys_obj__id  
LEFT JOIN isys_obj AS j14 ON j14.isys_obj__id = j16.isys_cats_person_list__isys_obj__id 
LEFT JOIN isys_connection AS j15 ON j15.isys_connection__id = j16.isys_cats_person_list__isys_connection__id 
LEFT JOIN isys_obj AS job15 ON j15.isys_connection__isys_obj__id = job15.isys_obj__id 
LEFT JOIN isys_catg_custom_fields_list AS 1268__C__CATG__CUSTOM_FIELDS_EIN_UND_AUSTRITTSDATUM ON j16.isys_cats_person_list__isys_obj__id = 1268__C__CATG__CUSTOM_FIELDS_EIN_UND_AUSTRITTSDATUM.isys_catg_custom_fields_list__isys_obj__id
                                AND 1268__C__CATG__CUSTOM_FIELDS_EIN_UND_AUSTRITTSDATUM.isys_catg_custom_fields_list__isysgui_catg_custom__id = (SELECT isysgui_catg_custom__id FROM isysgui_catg_custom WHERE isysgui_catg_custom__const = 'C__CATG__CUSTOM_FIELDS_EIN_UND_AUSTRITTSDATUM')
                                AND 1268__C__CATG__CUSTOM_FIELDS_EIN_UND_AUSTRITTSDATUM.isys_catg_custom_fields_list__field_type = 'commentary'  LEFT JOIN isys_catg_custom_fields_list AS j17 ON j16.isys_cats_person_list__isys_obj__id = j17.isys_catg_custom_fields_list__isys_obj__id AND j17.isys_catg_custom_fields_list__field_key = 'c_17628546009944330' 
                                AND j17.isys_catg_custom_fields_list__data__id = 1268__C__CATG__CUSTOM_FIELDS_EIN_UND_AUSTRITTSDATUM.isys_catg_custom_fields_list__data__id   
 LEFT JOIN isys_catg_custom_fields_list AS j18 ON j16.isys_cats_person_list__isys_obj__id = j18.isys_catg_custom_fields_list__isys_obj__id AND j18.isys_catg_custom_fields_list__field_key = 'c_17628546009946731'  AND j18.isys_catg_custom_fields_list__data__id = 1268__C__CATG__CUSTOM_FIELDS_EIN_UND_AUSTRITTSDATUM.isys_catg_custom_fields_list__data__id   
LEFT JOIN isys_obj_type AS j20 ON j20.isys_obj_type__id = obj_main.isys_obj__isys_obj_type__id 
LEFT JOIN isys_cmdb_status AS j1 ON j1.isys_cmdb_status__id = obj_main.isys_obj__isys_cmdb_status__id 

WHERE TRUE 
 AND  ( (j20.isys_obj_type__id != '60' ) AND (j20.isys_obj_type__id != '63' ) ) AND ( (j20.isys_obj_type__id = '54' ) ) AND ( j2.isys_cats_person_group_list__ldap_group LIKE '%M365_LIC%' ) AND ( (j1.isys_cmdb_status__id = '6' ) )
 ORDER BY j2.isys_cats_person_group_list__title ASC