I have two tables: o_daily_lcsgeneration and o_daily_generation.

While trying to update the o_daily_generation I receive an error saying:

error(1111) invalid use of Group function

Here is the code I am running:

update o_daily_generation join o_daily_lcsgeneration 
on o_daily_generation.Location =o_daily_lcsgeneration.Location 
   and o_daily_generation.Date =o_daily_lcsgeneration.Date  
set o_daily_lcsgeneration.Turbine_Generation =sum(o_daily_generation.Turbine_Generation)
Edit
Report