Hi
I need help with mysql query
SQL
select city, sum(sub.area_consumption) from (
select city, sum(amount_streetlight) / consumption as area_consumption
from MuniLEIMS.statisticalreport
group by city, area
) as sub
group by sub.cityI'm trying to calculate average consumption per area (every city has many areas)
it looks like it should work?

Nitin SontakkeRank #264 · 9.6K reputationPosted Aug 28, 2022, 8:31 AM EDT
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Aug 28, 2022, 8:42 AM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Aug 29, 2022, 12:34 AM EDT