SELECT 
nagios_instances.instance_id
,nagios_instances.instance_name
,nagios_contactgroups.contactgroup_id
,nagios_contactgroups.contactgroup_object_id
,obj1.name1 AS contactgroup_name
,nagios_contactgroups.alias AS contactgroup_alias
,nagios_contacts.contact_object_id 
,obj2.name1 AS contact_name
FROM `nagios_contactgroups` 
INNER JOIN nagios_contactgroup_members ON nagios_contactgroups.contactgroup_id=nagios_contactgroup_members.contactgroup_id 
INNER JOIN nagios_contacts ON nagios_contactgroup_members.contact_object_id=nagios_contacts.contact_object_id
INNER JOIN nagios_objects as obj1 ON nagios_contactgroups.contactgroup_object_id=obj1.object_id
INNER JOIN nagios_objects as obj2 ON nagios_contactgroup_members.contact_object_id=obj2.object_id
INNER JOIN nagios_instances ON nagios_contactgroups.instance_id=nagios_instances.instance_id