SELECT 
obj_main.isys_obj__id AS '__id__', 
obj_main.isys_obj__id 'isys_cmdb_dao_category_g_global__id', 
 (CONCAT(obj_main.isys_obj__title, ' {', obj_main.isys_obj__id, '}')   ) 'isys_cmdb_dao_category_g_global__title' , 
 (SELECT REPLACE(CONCAT('<ul><li>', GROUP_CONCAT(joined_content.isys_catg_custom_fields_list__field_content SEPARATOR '</li><li>'), '</li></ul>'), '<ul><li></li></ul>', '') 
                            FROM isys_catg_custom_fields_list AS root_custom_field
                            LEFT JOIN isys_catg_custom_fields_list AS joined_content
                            ON joined_content.isys_catg_custom_fields_list__data__id = root_custom_field.isys_catg_custom_fields_list__data__id
                            AND joined_content.isys_catg_custom_fields_list__field_key = 'c_1501762461759'  WHERE root_custom_field.isys_catg_custom_fields_list__status = 2 AND root_custom_field.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_ANGABENZUMVERFAHREN') AND root_custom_field.isys_catg_custom_fields_list__field_type = 'commentary'  AND root_custom_field.isys_catg_custom_fields_list__isys_obj__id = obj_main.isys_obj__id  AND root_custom_field.isys_catg_custom_fields_list__status = 2   GROUP BY root_custom_field.isys_catg_custom_fields_list__isys_obj__id  ) 'isys_cmdb_dao_category_g_custom_fields__f_wysiwyg_c_1501762461759' , 
 (SELECT REPLACE(CONCAT('<ul><li>', GROUP_CONCAT((CASE
                              WHEN isys_catg_contact_list__primary_contact > 0 THEN CONCAT(isys_obj__title, ' {', isys_obj__id, '}', ' (LC__CATG__CONTACT_PRIMARY)')
                              ELSE CONCAT(isys_obj__title, ' {', isys_obj__id, '}') END) SEPARATOR '</li><li>'), '</li></ul>'), '<ul><li></li></ul>', '')
                            FROM isys_catg_contact_list
                            INNER JOIN isys_connection ON isys_connection__id = isys_catg_contact_list__isys_connection__id
                            INNER JOIN isys_obj ON isys_obj__id = isys_connection__isys_obj__id AND isys_obj__status = 2  WHERE isys_catg_contact_list__isys_obj__id = obj_main.isys_obj__id  AND isys_catg_contact_list__status = 2   GROUP BY isys_catg_contact_list__isys_obj__id  ) 'isys_cmdb_dao_category_g_contact__contact_list'  

FROM isys_obj AS obj_main 
 

WHERE TRUE 
AND obj_main.isys_obj__isys_obj_type__id = 93 
