Hallo @ilkas
ich fürchte die Werte lassen sich nicht zusammenrechnen, wenn du "Dynamische Attribute" nutzt - das sind diejenigen Attribute die NICHT mit reiner SQL Logik gelesen werden sondern die Werte aus dem PHP Backend holen.
Die Attribute erkennst du daran, das die Labels aus solchen zusammengesetzten Werten bestehen wie isys_cmdb_dao_category_g_drive::dynamic_property_callback_capacity::isys_catg_drive_list__id::LC__CMDB_CATG__MEMORY_CAPACITY.
Um die Werte mit reinem SQL zu kombinieren und berechnen müsstest du mit Sub-Queries arbeiten und die Berechnung von Byte zu GB selbstständig vornehmen. Das müsste etwa so aussehen:
SELECT
obj_main.isys_obj__id AS '__id__',
obj_main.isys_obj__title AS 'LC__UNIVERSAL__TITLE###0_1',
-- j2.isys_catg_drive_list__id AS 'isys_cmdb_dao_category_g_drive::dynamic_property_callback_capacity::isys_catg_drive_list__id::LC__CMDB_CATG__MEMORY_CAPACITY',
-- j2.isys_catg_drive_list__id AS 'isys_cmdb_dao_category_g_drive::dynamic_property_callback_used_space::isys_catg_drive_list__id::LC__CMDB__CATG__DRIVE__USED_SPACE',
-- j2.isys_catg_drive_list__id AS 'isys_cmdb_dao_category_g_drive::dynamic_property_callback_free_space::isys_catg_drive_list__id::LC__CMDB__CATG__DRIVE__FREE_SPACE',
(SELECT CONCAT(ROUND(SUM(isys_catg_drive_list__capacity) / 1024 / 1024 / 1024, 2), ' GB') FROM isys_catg_drive_list WHERE isys_catg_drive_list__isys_obj__id = obj_main.isys_obj__id) AS 'Capacity',
(SELECT CONCAT(ROUND(SUM(isys_catg_drive_list__used_space) / 1024 / 1024 / 1024, 2), ' GB') FROM isys_catg_drive_list WHERE isys_catg_drive_list__isys_obj__id = obj_main.isys_obj__id) AS 'Used space',
(SELECT CONCAT(ROUND(SUM(isys_catg_drive_list__free_space) / 1024 / 1024 / 1024, 2), ' GB') FROM isys_catg_drive_list WHERE isys_catg_drive_list__isys_obj__id = obj_main.isys_obj__id) AS 'free space'
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_catg_drive_list AS j2 ON j2.isys_catg_drive_list__isys_obj__id = obj_main.isys_obj__id
LEFT JOIN isys_obj_type AS j4 ON j4.isys_obj_type__id = obj_main.isys_obj__isys_obj_type__id
WHERE TRUE
AND ( (j4.isys_obj_type__id != '60' ) AND (j4.isys_obj_type__id != '63' ) ) AND ( (j4.isys_obj_type__id = '59' ) )
ORDER BY obj_main.isys_obj__title DESC
Bitte schau mal ob das bereits ausreicht und inhaltlich korrekt ist 🙂 Die auskommentierten Teile der Query können entfernt werden.
VG Leo