I've a table
User_Engagement having columns :-
I was trying to implement this below formula on my update Query to calculate
TotalInteraction of all columns in a single query:-
totalInteraction = value in totalComments + value in totalLikes * ( SUM of averageLikes / SUM of averageComments)
So far I've tried to implement this query :-
UPDATE User_engagement AS ue SET ue.totalInteraction = (ue.totalComments + ue.totalLikes) * (SUM(ue.averageLikes)/SUM(ue.averageComments))
This above query is giving me an error
#1111 - Invalid use of group function in MySql.
A help is highly appreciated.