数据库名称:MariaDB
数据库版本:10.3.15
内容/问题描述:
想请教大家一下我有两张透过select产生的表,分别如下
表1:
SELECT processors.device_id,ROUND(AVG(processor_usage),2) FROM processors GROUP BY processors.device_id
http://i.imgur.com/b8t1htq.jpg
表2:
select
devices.device_id,devices.hostname,devices.sysName,mempools.mempool_descr,mempools.mempool_perc,storage.storage_descr,storage.storage_perc
from devices INNER JOIN mempools ON devices.device_id=mempools.device_id INNER JOIN storage ON devices.device_id=storage.device_id
WHERE (mempools.mempool_descr='Physical memory' OR mempools.mempool_descr='Real Memory') AND (storage.storage_descr = '/' OR storage.storage_descr = 'C:')
http://i.imgur.com/Qq4Fd5N.jpg
想问一下要怎么下SQL语法才能产生类似下面这张透过device_id合并过后的表,试了很久都不行,请前辈帮帮忙 感谢!!
http://i.imgur.com/neMy52r.jpg