0
Good afternoon, I opened a question yesterday but I could not express myself correctly, I have the following query
SELECT C.id, C.name as NomePC, C.serial AS Serial, MF.name AS Fabricante, CM.name AS ModeloPC,OS.name AS Sistema, OSV.name AS OSVersao,DP.designation AS Processador, IDH.capacity AS CapacidadeHD, DH.designation AS ModeloHD, DGC.designation AS PlacaVideo, IDM.size AS Memoria, DM.designation AS tipoMemoria
FROM glpi_computers AS C
INNER JOIN glpi_manufacturers AS MF ON C.manufacturers_id = MF.id
INNER JOIN glpi_computermodels as CM ON C.computermodels_id = CM.id
INNER JOIN glpi_operatingsystems AS OS ON C.operatingsystems_id = OS.id
INNER JOIN glpi_operatingsystemversions AS OSV ON C.operatingsystemversions_id = OSV.id
INNER JOIN glpi_items_deviceprocessors AS IDP ON C.id = IDP.items_id
INNER JOIN glpi_deviceprocessors AS DP on IDP.deviceprocessors_id = DP.id
INNER JOIN glpi_items_deviceharddrives AS IDH on C.id = IDH.items_id
INNER JOIN glpi_deviceharddrives AS DH on IDH.deviceharddrives_id = DH.id
INNER JOIN glpi_items_devicegraphiccards AS IDGC on C.id = IDGC.items_id
INNER JOIN glpi_devicegraphiccards AS DGC ON IDGC.devicegraphiccards_id = DGC.id
INNER JOIN glpi_items_devicememories AS IDM on C.id = IDM.items_id
INNER JOIN glpi_devicememories AS DM on IDM.devicememories_id = DM.id
WHERE C.id = 271 AND IDH.capacity != 0
and I’m getting the following result
when the PC has more than one ram memory comb I get 2 query results as shown in the image, I need to get only ONE result however ADDING the amount of memory as in the image below (I had to erase the image for not having enough reputation to post 3 images)
how can I do this by mysql itself?
RESOLVED
Now I have another problem, I tried to replicate the solution (use SUM) in HD, however it ta doubling the size of my hard drive, it is only 500gb and as a result of the query I am getting double
Please avoid long discussions in the comments; your talk was moved to the chat
– Maniero