能帮我如何在单个表中连接两个查询吗?>
发光细节表:
select mac_id, round(sum(luminary_count::int * wattage::int)::numeric/100, 2) as rated_power from luminary_details AS A join geo_light as gl on A.mac_id = gl.id group by A.mac_id
// lastupdated_all
select mac_id, (tactivep::numeric)
from lastupdated_all AS A
join geo_light as gl on A.mac_id = gl.id
group by A.mac_id
[能帮我如何在单个表的发光细节表中加入两个查询:从...中选择mac_id,round(sum(luminary_count :: int * wattage :: int):: numeric / 100,2)作为rated_power ...
您可以使用geo_ligth作为主表,并以子选择..的方式将2个查询左联接为..通过id = mac_id联接