Ajay

Ajay

  • NA
  • 27
  • 4.7k

calculate average consumption per area,it looks like it should work?

Aug 28 2022 11:55 AM

Hi
I need help with mysql query

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.city

I'm trying to calculate average consumption per area (every city has many areas)
it looks like it should work?


Answers (3)